mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
should be good
This commit is contained in:
parent
67c53c520d
commit
a8d8517876
1 changed files with 6 additions and 0 deletions
|
@ -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++;
|
||||||
|
|
Loading…
Reference in a new issue