Skip to content

Commit

Permalink
feat(tickets): buttons for claim/cancel/close
Browse files Browse the repository at this point in the history
  • Loading branch information
DaStormer committed Mar 12, 2024
1 parent dfa19f3 commit f4fd5dc
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions managers/TicketsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(() => { });

Expand Down

0 comments on commit f4fd5dc

Please sign in to comment.