From fe0c2d23bd54cfb92c6ed65bd9a2f7d58d73d34d Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Thu, 25 May 2023 21:17:54 -0500 Subject: [PATCH] add protections into command --- commands/removePhrase.cjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/commands/removePhrase.cjs b/commands/removePhrase.cjs index b493575..7371717 100644 --- a/commands/removePhrase.cjs +++ b/commands/removePhrase.cjs @@ -16,8 +16,13 @@ module.exports = { async execute(interaction) { var abbreviation = interaction.options.getString('abbreviation').toLowerCase(); //var phrase = interaction.options.getString('phrase'); - await interaction.reply('Removing abbreviation `' + abbreviation + "` from the target list..."); - removePhrase(abbreviation); + if (message.member.roles.cache.some(role => role.name == "Trusted Users")) { + await interaction.reply('Removing abbreviation `' + abbreviation + "` from the target list..."); + removePhrase(abbreviation); + } else { + await interaction.reply('Sorry, but you are not authorized to run this command...'); + } + }, };