Update commands to slash commands
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
var libUtils = require("../libUtils.js");
|
||||
const libUtils = require("../libUtils.js");
|
||||
const discordAuth = require("../utilities/discordAuthorization");
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'exit',
|
||||
description: 'Exit the current application.',
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('exit')
|
||||
.setDescription('Exit the current application.'),
|
||||
example: "exit",
|
||||
isPrivileged: true,
|
||||
async execute(message) {
|
||||
isPrivileged: true,
|
||||
async execute(interaction) {
|
||||
// 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(
|
||||
`Goodbye world - Disconnection imminent.`
|
||||
);
|
||||
await libUtils.sleep(5000);
|
||||
await new Promise(resolve => setTimeout(process.exit(), 5000));
|
||||
discordAuth.authorizeCommand(interaction, this.data.name, async () => {
|
||||
await interaction.reply(
|
||||
`Goodbye world - Disconnection imminent.`
|
||||
);
|
||||
libUtils.runAfter(process.exit, 5000);
|
||||
})
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user