mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 09:23:07 +02:00
fix: update reject button correctly
This commit is contained in:
parent
a0ffbae36d
commit
42ad5216f6
@ -58,27 +58,45 @@ module.exports = class CloseButton extends Button {
|
||||
}
|
||||
} else {
|
||||
// TODO: reply
|
||||
if (client.tickets.$stale.has(ticket.id)) {
|
||||
try {
|
||||
await interaction.channel.messages.edit(
|
||||
client.tickets.$stale.get(ticket.id).message.id,
|
||||
{
|
||||
components: [],
|
||||
embeds: [
|
||||
new ExtendedEmbedBuilder({
|
||||
iconURL: interaction.guild.iconURL(),
|
||||
text: ticket.guild.footer,
|
||||
})
|
||||
.setColor(ticket.guild.errorColour)
|
||||
.setDescription(getMessage('ticket.close.rejected', { user: interaction.user.toString() }))
|
||||
.setFooter({ text: null }),
|
||||
],
|
||||
},
|
||||
);
|
||||
} finally { // this should run regardless of whatever happens above
|
||||
client.tickets.$stale.delete(ticket.id);
|
||||
}
|
||||
try {
|
||||
await interaction.update({
|
||||
components: [],
|
||||
embeds: [
|
||||
new ExtendedEmbedBuilder({
|
||||
iconURL: interaction.guild.iconURL(),
|
||||
text: ticket.guild.footer,
|
||||
})
|
||||
.setColor(ticket.guild.errorColour)
|
||||
.setDescription(getMessage('ticket.close.rejected', { user: interaction.user.toString() }))
|
||||
.setFooter({ text: null }),
|
||||
],
|
||||
});
|
||||
|
||||
} finally { // this should run regardless of whatever happens above
|
||||
client.tickets.$stale.delete(ticket.id);
|
||||
}
|
||||
|
||||
// if (client.tickets.$stale.has(ticket.id)) {
|
||||
// try {
|
||||
// await interaction.channel.messages.edit(
|
||||
// client.tickets.$stale.get(ticket.id).message.id,
|
||||
// {
|
||||
// components: [],
|
||||
// embeds: [
|
||||
// new ExtendedEmbedBuilder({
|
||||
// iconURL: interaction.guild.iconURL(),
|
||||
// text: ticket.guild.footer,
|
||||
// })
|
||||
// .setColor(ticket.guild.errorColour)
|
||||
// .setDescription(getMessage('ticket.close.rejected', { user: interaction.user.toString() }))
|
||||
// .setFooter({ text: null }),
|
||||
// ],
|
||||
// },
|
||||
// );
|
||||
// } finally { // this should run regardless of whatever happens above
|
||||
// client.tickets.$stale.delete(ticket.id);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user