(buttons): Type-checking & linting.

This commit is contained in:
2026-10-14 12:57:09 +08:00
parent 6c7fe40f54
commit 687b647ca8
6 changed files with 25 additions and 25 deletions
+6 -6
View File
@@ -10,22 +10,22 @@ class CloseModTicketButton implements Button<Client> {
try {
const channel = await context.channels.fetch(interaction.channelId);
if (!channel) throw new Error("The interaction channel couldn't be fetched.");
if (!channel.isThread() || channel.type != ChannelType.PrivateThread) throw new Error('This interaction was not run in a ticket thread.');
if (!channel.isSendable()) throw new Error("I don't have permission to send messages in this channel.");
if (!interaction.memberPermissions.has('KickMembers')) throw new Error("You don't have permission to close this ticket.");
await interaction.message.edit({
content: interaction.message.content,
components: []
});
await channel.send('This ticket has been closed by staff.');
await interaction.editReply({ content: 'Ticket closed.' });
await channel.edit({
archived: true,
locked: true