should be good

This commit is contained in:
Jonny_Bro (Nikita) 2023-11-30 17:36:02 +05:00
parent 67c53c520d
commit a8d8517876

View file

@ -41,6 +41,12 @@ class CreateTicketEmbed extends BaseCommand {
const button = interaction.component; const button = interaction.component;
if (button.customId === "support_ticket") { if (button.customId === "support_ticket") {
if (interaction.guild.channels.cache.get(ticketsCategory).children.cache.size >= 50) {
const sorted = interaction.guild.channels.cache.get(ticketsCategory).children.cache.sort((ch1, ch2) => ch1.createdTimestamp - ch2.createdTimestamp);
await sorted.first().delete();
}
if (guildData.plugins.tickets.count === undefined) guildData.plugins.tickets.count = 0; if (guildData.plugins.tickets.count === undefined) guildData.plugins.tickets.count = 0;
guildData.plugins.tickets.count++; guildData.plugins.tickets.count++;