Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix: use deferUpdate() to close modals
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Jun 27, 2023
1 parent f653dd6 commit cb9f5c5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/buttons/appeals/approve.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ module.exports = {

await interaction.message.edit({ embeds: interaction.message.embeds, components: [] });

await i.deferUpdate();

const appealLog = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setAuthor({ name: interaction.user.tag.endsWith("#0") ? `@${interaction.user.username}` : interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${interaction.user.id}` })
Expand Down
2 changes: 2 additions & 0 deletions src/buttons/appeals/deny.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ module.exports = {

await interaction.message.edit({ embeds: interaction.message.embeds, components: [] });

await i.deferUpdate();

const appealLog = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setAuthor({ name: interaction.user.tag.endsWith("#0") ? `@${interaction.user.username}` : interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${interaction.user.id}` })
Expand Down
6 changes: 0 additions & 6 deletions src/buttons/logs/ban.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ module.exports = {

await interaction.message.edit({ embeds: interaction.message.embeds, components: [] });

const banned = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setDescription(`${emoji.successful} ${user} has been banned.`)

await i.editReply({ embeds: [banned], components: [], ephemeral: true });

const banLog = new Discord.EmbedBuilder()
.setColor(client.config_embeds.default)
.setAuthor({ name: interaction.user.tag.endsWith("#0") ? `@${interaction.user.username}` : interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ format: "png", dynamic: true }), url: `https://discord.com/users/${interaction.user.id}` })
Expand Down
2 changes: 2 additions & 0 deletions src/buttons/suggestions/approve.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ module.exports = {
interaction.message.embeds.push(approved);

await interaction.message.edit({ embeds: interaction.message.embeds, components: [] });

await i.deferUpdate();
}
})
} catch(err) {
Expand Down
2 changes: 2 additions & 0 deletions src/buttons/suggestions/deny.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ module.exports = {
interaction.message.embeds.push(denied);

await interaction.message.edit({ embeds: interaction.message.embeds, components: [] });

await i.deferUpdate();
}
})
} catch(err) {
Expand Down

0 comments on commit cb9f5c5

Please sign in to comment.