From c516c738a4a5ff2c35b97cd98067a4b54f71dff8 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 15 Nov 2023 16:56:39 +0100 Subject: [PATCH 1/4] Added @params to textinputbox events for easier development Signed-off-by: Taken --- events/modals/denyreasonbox.js | 2 ++ events/modals/staffdenyreasonbox.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/events/modals/denyreasonbox.js b/events/modals/denyreasonbox.js index 3f78db0..ec976b1 100644 --- a/events/modals/denyreasonbox.js +++ b/events/modals/denyreasonbox.js @@ -10,6 +10,8 @@ module.exports = { description: 'Deny reason box.', type: 'modal', + /** @param {import('discord.js').ModalSubmitInteraction} interaction */ + async execute(interaction) { if (interaction.type !== InteractionType.ModalSubmit) return; diff --git a/events/modals/staffdenyreasonbox.js b/events/modals/staffdenyreasonbox.js index 882574b..c7c5c95 100644 --- a/events/modals/staffdenyreasonbox.js +++ b/events/modals/staffdenyreasonbox.js @@ -10,6 +10,8 @@ module.exports = { description: 'Deny reason box.', type: 'modal', + /** @param {import('discord.js').ModalSubmitInteraction} interaction */ + async execute(interaction) { if (interaction.type !== InteractionType.ModalSubmit) return; @@ -17,7 +19,6 @@ module.exports = { interaction.deferReply(); - const channel = interaction.channel; const guild = interaction.guild; const reason = interaction.fields.fields.get('staffdenyreason').value || "No reason provided"; const embedColor = Number(color.replace("#", "0x")); From cf5f8be29f050613c0f505dc058bcbc1d27ca456 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 15 Nov 2023 18:14:04 +0100 Subject: [PATCH 2/4] Added @params options to buttons --- events/buttons/checkstats.js | 2 ++ events/buttons/guildapplicationaccept.js | 2 ++ events/buttons/guildapplicationdeny.js | 2 ++ events/buttons/guildapply.js | 2 ++ events/buttons/guildinactivitylog.js | 2 ++ events/buttons/inactiveapplicationaccept.js | 2 ++ events/buttons/inactiveapplicationdeny.js | 2 ++ events/buttons/staffapplicationaccept.js | 2 ++ events/buttons/staffapplicationdeny.js | 2 ++ events/buttons/staffapply.js | 2 ++ events/buttons/verify.js | 2 ++ events/buttons/waitingListUpdate.js | 2 ++ 12 files changed, 24 insertions(+) diff --git a/events/buttons/checkstats.js b/events/buttons/checkstats.js index c235c0b..d719788 100644 --- a/events/buttons/checkstats.js +++ b/events/buttons/checkstats.js @@ -10,6 +10,8 @@ module.exports = { description: 'Check your stats.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { await interaction.deferReply(); diff --git a/events/buttons/guildapplicationaccept.js b/events/buttons/guildapplicationaccept.js index dcc30af..4be7a03 100644 --- a/events/buttons/guildapplicationaccept.js +++ b/events/buttons/guildapplicationaccept.js @@ -10,6 +10,8 @@ module.exports = { description: 'Accept a guild application.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { await interaction.deferReply(); diff --git a/events/buttons/guildapplicationdeny.js b/events/buttons/guildapplicationdeny.js index 8c51b3e..6e0079a 100644 --- a/events/buttons/guildapplicationdeny.js +++ b/events/buttons/guildapplicationdeny.js @@ -6,6 +6,8 @@ module.exports = { description: 'Deny a guild application.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const modal = new ModalBuilder() diff --git a/events/buttons/guildapply.js b/events/buttons/guildapply.js index 662b042..8b91bab 100644 --- a/events/buttons/guildapply.js +++ b/events/buttons/guildapply.js @@ -14,6 +14,8 @@ module.exports = { description: 'Guild application button.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const user = interaction.user; diff --git a/events/buttons/guildinactivitylog.js b/events/buttons/guildinactivitylog.js index 87b1b00..0d5abaa 100644 --- a/events/buttons/guildinactivitylog.js +++ b/events/buttons/guildinactivitylog.js @@ -10,6 +10,8 @@ module.exports = { description: "Configure the bot.", type: "button", + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const guild = interaction.guild; const user = interaction.user; diff --git a/events/buttons/inactiveapplicationaccept.js b/events/buttons/inactiveapplicationaccept.js index 7f754ca..009e53b 100644 --- a/events/buttons/inactiveapplicationaccept.js +++ b/events/buttons/inactiveapplicationaccept.js @@ -3,6 +3,8 @@ module.exports = { description: "Accept an inactivity application.", type: "button", + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { await interaction.reply({ content: "This button is currently disabled.", ephemeral: true }); diff --git a/events/buttons/inactiveapplicationdeny.js b/events/buttons/inactiveapplicationdeny.js index 811bbe9..4878755 100644 --- a/events/buttons/inactiveapplicationdeny.js +++ b/events/buttons/inactiveapplicationdeny.js @@ -3,6 +3,8 @@ module.exports = { description: "Denies an inactivity application.", type: "button", + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { await interaction.reply({ content: "This button is currently disabled.", ephemeral: true }); diff --git a/events/buttons/staffapplicationaccept.js b/events/buttons/staffapplicationaccept.js index 05ce69e..8e582dc 100644 --- a/events/buttons/staffapplicationaccept.js +++ b/events/buttons/staffapplicationaccept.js @@ -7,6 +7,8 @@ module.exports = { description: 'Accept a staff application.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const user = interaction.user; diff --git a/events/buttons/staffapplicationdeny.js b/events/buttons/staffapplicationdeny.js index 3910465..2215456 100644 --- a/events/buttons/staffapplicationdeny.js +++ b/events/buttons/staffapplicationdeny.js @@ -5,6 +5,8 @@ module.exports = { description: 'Deny a guild application.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const modal = new ModalBuilder() diff --git a/events/buttons/staffapply.js b/events/buttons/staffapply.js index 6d6c4bb..a7bac0d 100644 --- a/events/buttons/staffapply.js +++ b/events/buttons/staffapply.js @@ -15,6 +15,8 @@ module.exports = { description: 'Apply for the staff team.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const user = interaction.user; diff --git a/events/buttons/verify.js b/events/buttons/verify.js index 7c203bc..b9fc2ad 100644 --- a/events/buttons/verify.js +++ b/events/buttons/verify.js @@ -6,6 +6,8 @@ module.exports = { description: 'Configure the bot.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { const modal = new ModalBuilder() diff --git a/events/buttons/waitingListUpdate.js b/events/buttons/waitingListUpdate.js index 97b4e6f..d0d348f 100644 --- a/events/buttons/waitingListUpdate.js +++ b/events/buttons/waitingListUpdate.js @@ -9,6 +9,8 @@ module.exports = { description: 'Update the waiting list.', type: 'button', + /** @param {import('discord.js').ButtonInteraction} interaction */ + async execute(interaction) { await interaction.deferReply({ ephemeral: true }); From a9ec8ce7a392f2a33756761a31c13a501e59d592 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 15 Nov 2023 18:15:03 +0100 Subject: [PATCH 3/4] Small typo --- events/modals/denyreasonbox.js | 2 +- events/modals/staffdenyreasonbox.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/events/modals/denyreasonbox.js b/events/modals/denyreasonbox.js index ec976b1..ac6008a 100644 --- a/events/modals/denyreasonbox.js +++ b/events/modals/denyreasonbox.js @@ -10,7 +10,7 @@ module.exports = { description: 'Deny reason box.', type: 'modal', - /** @param {import('discord.js').ModalSubmitInteraction} interaction */ + /** @param {import('discord.js').ModalSubmitInteraction} interaction */ async execute(interaction) { diff --git a/events/modals/staffdenyreasonbox.js b/events/modals/staffdenyreasonbox.js index c7c5c95..3670172 100644 --- a/events/modals/staffdenyreasonbox.js +++ b/events/modals/staffdenyreasonbox.js @@ -10,7 +10,7 @@ module.exports = { description: 'Deny reason box.', type: 'modal', - /** @param {import('discord.js').ModalSubmitInteraction} interaction */ + /** @param {import('discord.js').ModalSubmitInteraction} interaction */ async execute(interaction) { From b897670c975c266ee62329c8981c5229b3002e26 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 15 Nov 2023 18:22:05 +0100 Subject: [PATCH 4/4] Typo --- commands-contextmenu/congratsmessage.js | 2 +- commands-contextmenu/resetnick.js | 2 +- commands-testing/dev-info.js | 2 +- commands/ban.js | 2 +- commands/check.js | 2 +- commands/config.js | 2 +- commands/devel.js | 2 +- commands/forceunverify.js | 2 +- commands/forceupdate.js | 2 +- commands/forceverify.js | 2 +- commands/help.js | 2 +- commands/kick.js | 2 +- commands/remove.js | 2 +- commands/reqs.js | 2 +- commands/send.js | 2 +- commands/setnick.js | 2 +- commands/setup.js | 2 +- commands/slowmode.js | 2 +- commands/update.js | 2 +- commands/verify.js | 2 +- commands/whois.js | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/commands-contextmenu/congratsmessage.js b/commands-contextmenu/congratsmessage.js index 4a7e3fd..0a806a8 100644 --- a/commands-contextmenu/congratsmessage.js +++ b/commands-contextmenu/congratsmessage.js @@ -10,7 +10,7 @@ module.exports = { .setType(ApplicationCommandType.Message) .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages), - /** @param { import('discord.js').ContextMenuCommandInteraction } interaction */ + /** @param { import('discord.js').ContextMenuCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands-contextmenu/resetnick.js b/commands-contextmenu/resetnick.js index 72070a3..2218aa4 100644 --- a/commands-contextmenu/resetnick.js +++ b/commands-contextmenu/resetnick.js @@ -10,7 +10,7 @@ module.exports = { .setType(ApplicationCommandType.User) .setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames), - /** @param { import('discord.js').ContextMenuCommandInteraction } interaction */ + /** @param { import('discord.js').ContextMenuCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands-testing/dev-info.js b/commands-testing/dev-info.js index 83ee3c9..38f2665 100644 --- a/commands-testing/dev-info.js +++ b/commands-testing/dev-info.js @@ -24,7 +24,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/ban.js b/commands/ban.js index f277ad6..e87c3eb 100644 --- a/commands/ban.js +++ b/commands/ban.js @@ -36,7 +36,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute (interaction) { diff --git a/commands/check.js b/commands/check.js index db02613..e8239f7 100644 --- a/commands/check.js +++ b/commands/check.js @@ -18,7 +18,7 @@ module.exports = { .setRequired(true)) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/config.js b/commands/config.js index a759e84..4ec149c 100644 --- a/commands/config.js +++ b/commands/config.js @@ -28,7 +28,7 @@ module.exports = { .setDMPermission(false) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/devel.js b/commands/devel.js index b38d16e..7c28ed5 100644 --- a/commands/devel.js +++ b/commands/devel.js @@ -32,7 +32,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/forceunverify.js b/commands/forceunverify.js index bda901b..fee0be2 100644 --- a/commands/forceunverify.js +++ b/commands/forceunverify.js @@ -21,7 +21,7 @@ module.exports = { .setDMPermission(false) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { const member1 = interaction.options.getUser('user'); diff --git a/commands/forceupdate.js b/commands/forceupdate.js index dff4194..f85e0eb 100644 --- a/commands/forceupdate.js +++ b/commands/forceupdate.js @@ -22,7 +22,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/forceverify.js b/commands/forceverify.js index 351fb2f..bb1e84c 100644 --- a/commands/forceverify.js +++ b/commands/forceverify.js @@ -26,7 +26,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/help.js b/commands/help.js index 03ee558..189974c 100644 --- a/commands/help.js +++ b/commands/help.js @@ -11,7 +11,7 @@ module.exports = { .setDescription('Help command') .setDMPermission(true), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/kick.js b/commands/kick.js index da87717..72d5dd5 100644 --- a/commands/kick.js +++ b/commands/kick.js @@ -22,7 +22,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/remove.js b/commands/remove.js index 4509234..56bc671 100644 --- a/commands/remove.js +++ b/commands/remove.js @@ -25,7 +25,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { const user = interaction.options.getUser('user'); diff --git a/commands/reqs.js b/commands/reqs.js index 473a36f..0e3bfb1 100644 --- a/commands/reqs.js +++ b/commands/reqs.js @@ -10,7 +10,7 @@ module.exports = { .setName('reqs') .setDescription('Displays the requirements for the guild.'), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/send.js b/commands/send.js index 1a31b0a..de6b345 100644 --- a/commands/send.js +++ b/commands/send.js @@ -20,7 +20,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/setnick.js b/commands/setnick.js index cfba22f..e6c65fe 100644 --- a/commands/setnick.js +++ b/commands/setnick.js @@ -21,7 +21,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/setup.js b/commands/setup.js index d7118ac..5f27c40 100644 --- a/commands/setup.js +++ b/commands/setup.js @@ -58,7 +58,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { const user = interaction.user; diff --git a/commands/slowmode.js b/commands/slowmode.js index 416d524..2580864 100644 --- a/commands/slowmode.js +++ b/commands/slowmode.js @@ -20,7 +20,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/update.js b/commands/update.js index 1cdeb77..e066575 100644 --- a/commands/update.js +++ b/commands/update.js @@ -16,7 +16,7 @@ module.exports = { .setDescription('Update your guild rank.') .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { diff --git a/commands/verify.js b/commands/verify.js index 938455f..6cd047d 100644 --- a/commands/verify.js +++ b/commands/verify.js @@ -20,7 +20,7 @@ module.exports = { .setDescription("Your in-game name.")) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) { await interaction.deferReply(); diff --git a/commands/whois.js b/commands/whois.js index 36f5028..77e6c8b 100644 --- a/commands/whois.js +++ b/commands/whois.js @@ -19,7 +19,7 @@ module.exports = { .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDMPermission(false), - /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ + /** @param { import('discord.js').ChatInputCommandInteraction } interaction */ async execute(interaction) {