diff --git a/command/CODM/build.js b/command/CODM/build.js index b7ebe9e..b02bbb9 100644 --- a/command/CODM/build.js +++ b/command/CODM/build.js @@ -1,4 +1,4 @@ -const { EmbedBuilder } = require("discord.js"); +const { Client, CommandInteraction, EmbedBuilder } = require("discord.js"); const moment = require("moment"); const axios = require("axios"); module.exports = { @@ -657,6 +657,12 @@ module.exports = { ], }, ], + /** + * + * @param {Client} client + * @param {CommandInteraction} interaction + * @param {String[]} args + */ run: async (client, interaction, args) => { const cwts = args[1]; const cc = args[2]; diff --git a/command/Information/avatar.js b/command/Information/avatar.js index 37ce25e..3f2d5f3 100644 --- a/command/Information/avatar.js +++ b/command/Information/avatar.js @@ -1,4 +1,4 @@ -const { EmbedBuilder } = require("discord.js"); +const { Client, CommandInteraction, EmbedBuilder } = require("discord.js"); module.exports = { name: "avatar", description: "Show user's avatar in different formats", @@ -12,7 +12,12 @@ module.exports = { required: false, }, ], - run: async (client, interaction, args) => { + /** + * + * @param {Client} client + * @param {CommandInteraction} interaction + * @param {String[]} args + */ run: async (client, interaction, args) => { const member = interaction.guild.members.cache.get(args[0]) || interaction.member; const embed = new EmbedBuilder() diff --git a/command/Information/ping.js b/command/Information/ping.js index a019f75..6450ba9 100644 --- a/command/Information/ping.js +++ b/command/Information/ping.js @@ -2,7 +2,6 @@ const { EmbedBuilder } = require("discord.js"); module.exports = { name: "ping", description: "Check bot latency to Discord API", - category: "Information", run: async (client, interaction, args) => { const msg = await interaction.channel.send(`Pinging...`); diff --git a/events/interactionCreate.js b/events/interactionCreate.js index 78cf499..0c907da 100644 --- a/events/interactionCreate.js +++ b/events/interactionCreate.js @@ -9,7 +9,7 @@ client.on("interactionCreate", async interaction => { if (!cmd) return; const args = []; for (const option of interaction.options.data) { - if (option.type === "SUB_COMMAND_GROUP") { + if (option.type === 2) { if (option.name) args.push(option.name); option.options?.forEach(x => { if (x.type === 1) { @@ -23,7 +23,7 @@ client.on("interactionCreate", async interaction => { if (x.value) args.push(x.value); }); } - if (option.type === "SUB_COMMAND") { + if (option.type === 1) { if (option.name) args.push(option.name); option.options?.forEach(x => { if (x.value) args.push(x.value);