ticket now archive instead of deleting

This commit is contained in:
Danya H 2024-06-08 18:01:26 +01:00
parent a3841cf6c3
commit 7a4cafc3dd

View File

@ -89,7 +89,7 @@ export class CreateTicketSystem {
.then(() => logger.database(DBTableEnum.TICKET_ROLE, role.id)) .then(() => logger.database(DBTableEnum.TICKET_ROLE, role.id))
// create ticket embed + button // create ticket embed + button
await interaction.channel?.send({ await interaction.channel.send({
components: [ticketCreateButton()], components: [ticketCreateButton()],
embeds: [ticketCreateEmbed({ bannerURL, pricesChannelId })], embeds: [ticketCreateEmbed({ bannerURL, pricesChannelId })],
}) })
@ -185,6 +185,8 @@ export class CreateTicketSystem {
await interaction.editReply('❌ Ticket channel does not exist') await interaction.editReply('❌ Ticket channel does not exist')
return return
} }
await interaction.channel.delete() if (interaction.channel.isThread()) {
await interaction.channel.setArchived(true, `Archived by ${userMention(interaction.user.id)}(${interaction.user.id})`)
}
} }
} }