fix: #250 by deferring then editing the reply

This commit is contained in:
Isaac
2021-10-26 16:58:06 +01:00
parent 9bfee81157
commit d3ed6405db
14 changed files with 61 additions and 59 deletions

View File

@@ -165,7 +165,7 @@ module.exports = class CommandManager {
if (!bot_permissions.has(required_bot_permissions)) {
const perms = required_bot_permissions.map(p => `\`${p}\``).join(', ');
if (bot_permissions.has('EMBED_LINKS')) {
await interaction.reply({
await interaction.editReply({
embeds: [
new MessageEmbed()
.setColor('ORANGE')
@@ -174,7 +174,7 @@ module.exports = class CommandManager {
]
});
} else {
await interaction.reply({ content: i18n('bot.missing_permissions.description', perms) });
await interaction.editReply({ content: i18n('bot.missing_permissions.description', perms) });
}
return;
}
@@ -182,7 +182,7 @@ module.exports = class CommandManager {
const missing_permissions = command.permissions instanceof Array && !interaction.member.permissions.has(command.permissions);
if (missing_permissions) {
const perms = command.permissions.map(p => `\`${p}\``).join(', ');
return await interaction.reply({
return await interaction.editReply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
@@ -199,7 +199,7 @@ module.exports = class CommandManager {
} catch (e) {
this.client.log.warn(`An error occurred whilst executing the ${command.name} command`);
this.client.log.error(e);
await interaction.reply({
await interaction.editReply({
embeds: [
new MessageEmbed()
.setColor('ORANGE')