mirror of
https://github.com/nx-bat/discordbot-ng.git
synced 2026-11-11 07:13:37 -05:00
(tickets): Implement on close-mod-ticket button.
This commit is contained in:
@@ -5,7 +5,6 @@ export default {
|
||||
name: 'close-ticket',
|
||||
handler: async function (client: Client, interaction: ButtonInteraction) {
|
||||
const channel = await interaction.channel?.fetch();
|
||||
|
||||
if (!channel || !channel.isThread() || !channel.isSendable() || channel.type != ChannelType.PrivateThread)
|
||||
return await interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Oops. Something went wrong. Please report this to a staff member.' });
|
||||
|
||||
@@ -20,7 +19,7 @@ export default {
|
||||
});
|
||||
|
||||
if (!await closeTicket(client, channel, `This ticket has been closed by ${interaction.user}`))
|
||||
return await interaction.editReply({ content: 'An error occured while trying to close this ticket.' });
|
||||
return await interaction.editReply({ content: 'An error occurred while trying to close this ticket.' });
|
||||
|
||||
await interaction.editReply({ content: 'Ticket closed.' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user