Make messages reply to the interaction instd of sending message

This commit is contained in:
Sophie Marie 2022-11-10 14:52:49 -06:00
parent b817c6b997
commit 3d09aee2df
1 changed files with 10 additions and 10 deletions

View File

@ -5,27 +5,27 @@ module.exports = {
options: [], options: [],
async parseInteraction (client, config, interaction) { async parseInteraction (client, config, interaction) {
await this.handle(client, config, interaction.user, interaction.channel); await this.handle(client, config, interaction);
}, },
async handle (client, config, user, channel) { async handle (client, config, interaction) {
if (user.id === process.env.OWNERID) { if (interaction.user.id === process.env.OWNERID) {
console.log('[SYSTEM] [INFO] ' + `The bot is going down for shut down. \nShutdown requested by ${user.username}`); console.log('[SYSTEM] [INFO] ' + `The bot is going down for shut down. Shutdown requested by ${interaction.user.username}`);
await channel.send({ await interaction.reply({
embeds: [{ embeds: [{
title: '**Shut down the bot**', title: 'Shutdown bot',
description: '<a:AnitroxWorking:997565411212144730> **Shutting Down...**', description: '<a:AnitroxWorking:997565411212144730> Shutting Down...',
color: 9442302, color: 9442302,
footer: { footer: {
icon_url: user.displayAvatarURL(), icon_url: interaction.user.displayAvatarURL(),
text: config.footerTxt text: config.footerTxt
} }
}] }]
}); });
process.exit(); process.exit();
} else { } else {
console.error('[SYSTEM] [ERR] User ' + user.username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json"); console.error('[SYSTEM] [ERR] User ' + interaction.user.username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json");
await channel.send(client.generateErrorMessage('You do not have permission to run this command.', user.displayAvatarURL())); await interaction.reply(client.generateErrorMessage('You do not have permission to run this command.', interaction.user.displayAvatarURL()));
} }
} }
}; };