Fix additional conflicts manually.

This commit is contained in:
2026-10-20 16:30:59 +00:00
parent c3a831f198
commit 27481e6e04
2 changed files with 15 additions and 15 deletions
+5 -6
View File
@@ -1,5 +1,6 @@
import { ButtonInteraction, Client, MessageFlags, ChannelType } from 'discord.js'; import { ButtonInteraction, Client, MessageFlags, ChannelType } from 'discord.js';
import { Button } from '../types'; import { Button } from '../types';
import { closeTicket } from '../utils';
class CloseModTicketButton implements Button<Client> { class CloseModTicketButton implements Button<Client> {
id = 'close-mod-ticket'; id = 'close-mod-ticket';
@@ -22,14 +23,12 @@ class CloseModTicketButton implements Button<Client> {
components: [] components: []
}); });
await channel.send('This ticket has been closed by staff.'); if (!await closeTicket(context, channel, 'This ticket has been closed by staff.')) {
await interaction.editReply({ content: 'An error occurred while trying to close this ticket.' });
return;
}
await interaction.editReply({ content: 'Ticket closed.' }); await interaction.editReply({ content: 'Ticket closed.' });
await channel.edit({
archived: true,
locked: true
});
} catch (error: Error | any) { } catch (error: Error | any) {
await interaction.editReply({ content: error.message }).catch(() => {}); await interaction.editReply({ content: error.message }).catch(() => {});
} }
+10 -9
View File
@@ -1,6 +1,6 @@
import { ButtonInteraction, Client, MessageFlags, ChannelType } from 'discord.js'; import { ButtonInteraction, Client, MessageFlags, ChannelType } from 'discord.js';
import { Database } from '../shared/Database';
import { Button } from '../types'; import { Button } from '../types';
import { closeTicket } from '../utils';
class CloseTicketButton implements Button<Client> { class CloseTicketButton implements Button<Client> {
id = 'close-ticket'; id = 'close-ticket';
@@ -16,21 +16,22 @@ class CloseTicketButton implements Button<Client> {
if (!channel.isThread() || channel.type != ChannelType.PrivateThread) throw new Error('This interaction was not run in a ticket thread.'); 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 (!channel.isSendable()) throw new Error("I don't have permission to send messages in this channel.");
await interaction.reply({
content: 'Closing, please wait...',
flags: MessageFlags.Ephemeral
});
await interaction.message.edit({ await interaction.message.edit({
content: interaction.message.content, content: interaction.message.content,
components: [] components: []
}); });
await Database.closePrivateHelpTicket(channel.id); if (!await closeTicket(context, channel, `This ticket has been closed by ${interaction.user}`)) {
await interaction.editReply({ content: 'An error occurred while trying to close this ticket.' });
await channel.send(`This ticket has been closed by ${interaction.user}`); return;
}
await interaction.editReply({ content: 'Ticket closed.' }); await interaction.editReply({ content: 'Ticket closed.' });
await channel.edit({
archived: true,
locked: true
});
} catch (error: Error | any) { } catch (error: Error | any) {
await interaction.editReply({ content: error.message }).catch(() => {}); await interaction.editReply({ content: error.message }).catch(() => {});
} }