(buttons): Bug-testing round 1.

This commit is contained in:
2026-10-14 12:53:37 +08:00
parent 71e2d1c088
commit 6c7fe40f54
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ class CloseTicketButton implements Button<Client> {
await channel.send(`This ticket has been closed by ${interaction.user}`); await channel.send(`This ticket has been closed by ${interaction.user}`);
await interaction.reply({ flags: [MessageFlags.Ephemeral], content: 'Ticket closed.' }); await interaction.editReply({ content: 'Ticket closed.' });
await channel.edit({ await channel.edit({
archived: true, archived: true,
+2 -2
View File
@@ -42,9 +42,9 @@ class UnclaimTicketButton implements Button<Client> {
components: [row] components: [row]
}); });
await interaction.reply({ content: 'Ticket unclaimed.', flags: [MessageFlags.Ephemeral] }); await interaction.editReply({ content: 'Ticket unclaimed.' });
} catch (error: Error | any) { } catch (error: Error | any) {
await interaction.editReply({ content: error.message }).catch(() => {});
} }
} }
} }
+1 -1
View File
@@ -189,7 +189,7 @@ export default {
const moderatorChannel = interaction.options.getChannel('moderator-channel'); const moderatorChannel = interaction.options.getChannel('moderator-channel');
if (moderatorChannel) { if (moderatorChannel) {
await Database.updateSettings(interaction.guildId, 'moderator_channel_id', moderatorChannel.id); await Database.updateSettings(interaction.guildId, 'moderator_channel_id', moderatorChannel.id);
response.push(`**moderator_channel_id** has been set to": ${moderatorChannel}.`); response.push(`**moderator_channel_id** has been set to: ${moderatorChannel}.`);
} }
const adminRole = interaction.options.getRole('admin-role'); const adminRole = interaction.options.getRole('admin-role');
+1 -1
View File
@@ -95,7 +95,7 @@ client.on('interactionCreate', async (interaction) => {
for (const button of buttons) { for (const button of buttons) {
if (button.id != id) continue; if (button.id != id) continue;
Promise.resolve((button.execute as (context: Client, ...args: unknown[]) => Promise<void>)(client, ...interaction.customId.split('_').slice(1)) Promise.resolve((button.execute as (context: Client, ...args: unknown[]) => Promise<void>)(client, interaction, ...interaction.customId.split('_').slice(1))
.catch(e => console.error('An error occurred while handling a button interaction: ', e))); .catch(e => console.error('An error occurred while handling a button interaction: ', e)));
return; return;
} }