commit 7613c26752113c50adf129520f437ca413e1b915
parent 6d82a842cfe5eceebd6531934152ff8402b3fd8e
Author: NK <[email protected]>
Date: Thu, 6 Apr 2023 01:28:29 +0100
broken af
Diffstat:
4 files changed, 16 insertions(+), 6 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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);