mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-07 02:21:27 +03:00
fix: #250 by deferring then editing the reply
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user