From 979271cfb5db873bdb8781dc26b8d4bdbba1836d Mon Sep 17 00:00:00 2001 From: SypherRed Date: Thu, 23 Jun 2022 20:58:03 +0200 Subject: [PATCH 1/3] beta push of muted check push of a check if author has a muted role on ticket opening, if so, decline the interaction Also either check for missing role or not --- Commands/ticket.js | 12 ++++++++++-- Configs/supportbot.yml | 2 ++ Events/ready.js | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Commands/ticket.js b/Commands/ticket.js index 9be92a9..f4a5c9c 100644 --- a/Commands/ticket.js +++ b/Commands/ticket.js @@ -68,8 +68,16 @@ module.exports = new Command({ return interaction.reply({ content: supportbot.TicketBlackListMessage, ephemeral: true, - }); - } + }) + } else if (User.roles.cache.has( + getRole(supportbot.TicketMutedRole, interaction.guild).id + ) + ) { + return interaction.reply({ + content: supportbot.TicketMutedMessage, + ephemeral: true, + }) + }; // Ticket ID let ticketNumberID = await TicketNumberID.pad(); diff --git a/Configs/supportbot.yml b/Configs/supportbot.yml index b5b28db..e056ab4 100644 --- a/Configs/supportbot.yml +++ b/Configs/supportbot.yml @@ -52,6 +52,7 @@ JoinRole: "Member" Staff: "Staff" Admin: "Admin" TicketBlackListRole: "Blacklisted" +TicketMutedRole: "Muted" # ---------------------------- # Join/Leave Configuration @@ -136,6 +137,7 @@ DMTranscripts: true TranscriptTitle: "Ticket Transcript" TicketLog_Title: "Ticket Closed" TicketBlackListMessage: "You are not allowed to open a ticket" +TicketMutedMessage: "You are muted and therefore not allowed to open any tickets" TicketRoleMention: "@here" # To ping a role: <@ROLE_ID> diff --git a/Events/ready.js b/Events/ready.js index a3c80cc..bf828e3 100644 --- a/Events/ready.js +++ b/Events/ready.js @@ -82,6 +82,7 @@ module.exports = new Event("ready", async (client, interaction) => { supportbot.Admin, supportbot.Staff, supportbot.TicketBlackListRole, + supportbot?.TicketMutedRole ]; supportbot.Departments.forEach((department) => roles.push(department.role)); From 26e9b569612e16dd62af522a5adcfe70d8dbb619 Mon Sep 17 00:00:00 2001 From: SypherRed Date: Mon, 27 Jun 2022 19:03:34 +0200 Subject: [PATCH 2/3] Issue fix with Muted Role check Fixed the issue to recognize a Muted Role and made changes to ready.js accordingly --- Commands/ticket.js | 12 +++--------- Events/ready.js | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Commands/ticket.js b/Commands/ticket.js index f4a5c9c..99cd77a 100644 --- a/Commands/ticket.js +++ b/Commands/ticket.js @@ -60,19 +60,13 @@ module.exports = new Command({ ephemeral: true, }); } - if ( - User.roles.cache.has( - getRole(supportbot.TicketBlackListRole, interaction.guild).id - ) - ) { + if (User.roles.cache.has(supportbot.TicketBlackListRole)) { return interaction.reply({ content: supportbot.TicketBlackListMessage, ephemeral: true, }) - } else if (User.roles.cache.has( - getRole(supportbot.TicketMutedRole, interaction.guild).id - ) - ) { + }; + if (User.roles.cache.has(supportbot.TicketMutedRole)) { return interaction.reply({ content: supportbot.TicketMutedMessage, ephemeral: true, diff --git a/Events/ready.js b/Events/ready.js index bf828e3..3a74e7a 100644 --- a/Events/ready.js +++ b/Events/ready.js @@ -81,7 +81,7 @@ module.exports = new Event("ready", async (client, interaction) => { const roles = [ supportbot.Admin, supportbot.Staff, - supportbot.TicketBlackListRole, + supportbot?.TicketBlackListRole, supportbot?.TicketMutedRole ]; From cce1480a427e57ff94ca76513946e3a696cf4542 Mon Sep 17 00:00:00 2001 From: SypherRed Date: Wed, 29 Jun 2022 13:12:56 +0200 Subject: [PATCH 3/3] remove empty declaration AboutMe was removed in a previous version. --- Commands/info.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Commands/info.js b/Commands/info.js index 51ad789..b97213f 100644 --- a/Commands/info.js +++ b/Commands/info.js @@ -29,7 +29,6 @@ module.exports = new Command({ const InfoEmbed = new Discord.MessageEmbed() .setURL(supportbot.InfoURL) .setTitle(supportbot.InfoTitle) - .setDescription(supportbot.AboutMe) .setColor(supportbot.InfoColour); interaction.reply({