mirror of
https://github.com/nx-bat/discordbot-ng.git
synced 2026-11-11 07:13:37 -05:00
(buttons): Type-checking & linting.
This commit is contained in:
@@ -11,13 +11,13 @@ class ClaimTicketButton 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.");
|
||||
|
||||
const settings = await Database.getOrCreateSettings(interaction.guildId);
|
||||
if (!settings.private_help_role_id) throw new Error("\`private_help_role_id\` hasn't been configured. Please report this error to staff.");
|
||||
if (!settings.private_help_role_id) throw new Error("`private_help_role_id` hasn't been configured. Please report this error to staff.");
|
||||
|
||||
const guild = await context.guilds.fetch(interaction.guildId);
|
||||
const member = await guild.members.fetch(interaction.user.id);
|
||||
|
||||
Reference in New Issue
Block a user