Add and update references for libUtils
- Used for extra code that is used in multiple places
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
var libFlayer = require("../libFlayer.js");
|
var libUtils = require("../libUtils.js");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'exit',
|
name: 'exit',
|
||||||
description: 'Exit',
|
description: 'Exit the current application.',
|
||||||
|
example: "exit",
|
||||||
|
isPrivileged: true,
|
||||||
async execute(message) {
|
async execute(message) {
|
||||||
|
// TODO - Need to add middleware for admins
|
||||||
|
if (message.member.user.tag !== "Logan#3331") message.reply(`Sorry ${message.member.user.tag}, you are not allowed to use this command.`);
|
||||||
message.reply(
|
message.reply(
|
||||||
`Goodbye world - Disconnection imminent.`
|
`Goodbye world - Disconnection imminent.`
|
||||||
);
|
);
|
||||||
await libFlayer.sleep(5000);
|
await libUtils.sleep(5000);
|
||||||
await new Promise(resolve => setTimeout(process.exit(), 5000));
|
await new Promise(resolve => setTimeout(process.exit(), 5000));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
7
libUtils.js
Normal file
7
libUtils.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* sleep - sleep/wait
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
exports.sleep = (ms) => new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, ms);
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user