fix
This commit is contained in:
parent
3c07a2f271
commit
40d8a79002
@ -223,22 +223,26 @@ export class CreateTicketSystem {
|
||||
|
||||
@ButtonComponent({ id: 'close-btn' })
|
||||
async closeBtn(interaction: ButtonInteraction): Promise<void> {
|
||||
await interaction.deferReply()
|
||||
|
||||
logger.action(
|
||||
'Ticket close attempt',
|
||||
`User: ${interaction.user.username}(${interaction.user.id})\nChannel: ${interaction.channel?.id}`,
|
||||
)
|
||||
|
||||
if (!interaction.channel || !interaction.guild) {
|
||||
await interaction.editReply('❌ Ticket channel does not exist')
|
||||
return
|
||||
}
|
||||
|
||||
if (!interaction.channel.isThread() || interaction.channel.archived) {
|
||||
return
|
||||
}
|
||||
|
||||
await interaction.editReply('Closing ticket..')
|
||||
try {
|
||||
await interaction.deferReply()
|
||||
await interaction.editReply('Closing ticket..')
|
||||
} catch (e) {
|
||||
logger.error('Deferring interaction reply', e)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
// lock + archive thread
|
||||
|
Loading…
Reference in New Issue
Block a user