From e3967dda1edef3d7ce0835dcd9a41b4591459c02 Mon Sep 17 00:00:00 2001 From: Kieran Date: Sat, 9 Jul 2022 10:57:16 +0100 Subject: [PATCH] Added and update COC message --- events/interactionCreate.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/events/interactionCreate.js b/events/interactionCreate.js index a6b1a44..8046fb4 100644 --- a/events/interactionCreate.js +++ b/events/interactionCreate.js @@ -33,8 +33,16 @@ client.on("interactionCreate", async (interaction) => { // Button Handling if (interaction.isButton()) { if(interaction.customId == "codeOfConduct"){ - interaction.member.roles.add("973646380771979304") - await interaction.reply({ content: 'Roles have been updated', ephemeral: true}); + if(interaction.member.roles.cache.has("973646380771979304")) + { + interaction.reply({ content: 'You already have agreed to the code of conduct!', ephemeral: true}) + } + else + { + interaction.member.roles.add("973646380771979304") + await interaction.reply({ content: 'Thank you for agreeing to the code of conduct!\r\nYou can now access the rest of the server!', ephemeral: true}); + } + } if(interaction.customId == "paidModal")