From 6e52eae0de3823bcf273e7708b551afab69a1f82 Mon Sep 17 00:00:00 2001 From: KieranRobson Date: Mon, 27 Jun 2022 07:04:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Reformat=20InteractionCreate=20/?= =?UTF-8?q?=20Add=20Comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- events/interactionCreate.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/events/interactionCreate.js b/events/interactionCreate.js index 0e7581f..39a2c3d 100644 --- a/events/interactionCreate.js +++ b/events/interactionCreate.js @@ -1,4 +1,3 @@ - const client = require("../index"); const discord = require("discord.js") @@ -32,10 +31,9 @@ client.on("interactionCreate", async (interaction) => { const command = client.slashCommands.get(interaction.commandName); if (command) command.run(client, interaction); } - - // Context Menu Handling - if (interaction.isButton()) - { + + // Button Handling + if (interaction.isButton()) { if(interaction.customId == "codeOfConduct"){ interaction.member.roles.add("973646380771979304") await interaction.reply({ content: 'Roles have been updated', ephemeral: true}); @@ -83,10 +81,10 @@ client.on("interactionCreate", async (interaction) => { interaction.channel.setArchived(true) } } - } + } - if(interaction.isSelectMenu()) - { + // Select Menu Handling + if(interaction.isSelectMenu()) { if(interaction.customId == "yearSelect") { if(interaction.values.includes("0")) @@ -262,8 +260,8 @@ client.on("interactionCreate", async (interaction) => { } } - if(interaction.isModalSubmit) - { + // Modal Handling + if(interaction.isModalSubmit) { if(interaction.customId === 'modal-paidmember'){ const execchannel = client.channels.cache.get('981678376655921153')