From f4fd5dc8da2eb7eb8feb05fa2cb498fba4068ac7 Mon Sep 17 00:00:00 2001 From: DaStormer Date: Tue, 12 Mar 2024 17:46:45 -0400 Subject: [PATCH] feat(tickets): buttons for claim/cancel/close --- managers/TicketsManager.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/managers/TicketsManager.js b/managers/TicketsManager.js index f855173..e07e487 100644 --- a/managers/TicketsManager.js +++ b/managers/TicketsManager.js @@ -40,7 +40,19 @@ class TicketsManager { .setColor("Yellow") .setTimestamp(); - await this.getQueueChannel(member.guild).send({ embeds: [queueEmbed] }); + const buttons = new ActionRowBuilder() + .setComponents( + new ButtonBuilder() + .setLabel("Claim") + .setCustomId("claim") + .setStyle(ButtonStyle.Success), + new ButtonBuilder() + .setLabel("Cancel") + .setCustomId("cancel") + .setStyle(ButtonStyle.Danger), + ); + + await this.getQueueChannel(member.guild).send({ embeds: [queueEmbed], components: [buttons] }); return; @@ -68,7 +80,15 @@ class TicketsManager { ticket.members.add(mentor.id); ticket.members.add(member.id); - ticket.send({ content: `**Mentor:** ${mentor.toString()}\n**Hacker:** ${member.toString()}`, embeds: [newEmbed.setColor("Blurple")] }); + const closeButton = new ActionRowBuilder() + .setComponents( + new ButtonBuilder() + .setLabel("Close") + .setCustomId("close") + .setStyle(ButtonStyle.Danger), + ); + + ticket.send({ content: `**Mentor:** ${mentor.toString()}\n**Hacker:** ${member.toString()}`, embeds: [newEmbed.setColor("Blurple")], components: [closeButton] }); member.send({ embeds: [this.MentorQ.util.infoEmbed(`Your mentor request ticket has been opened. Contact your mentor here: ${ticket.toString()}`)] }).catch(() => { });