broken af

This commit is contained in:
NK 2023-04-06 01:28:29 +01:00
parent 6d82a842cf
commit 7613c26752
4 changed files with 16 additions and 6 deletions

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
const moment = require("moment"); const moment = require("moment");
const axios = require("axios"); const axios = require("axios");
module.exports = { module.exports = {
@ -657,6 +657,12 @@ module.exports = {
], ],
}, },
], ],
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const cwts = args[1]; const cwts = args[1];
const cc = args[2]; const cc = args[2];

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
module.exports = { module.exports = {
name: "avatar", name: "avatar",
description: "Show user's avatar in different formats", description: "Show user's avatar in different formats",
@ -12,7 +12,12 @@ module.exports = {
required: false, required: false,
}, },
], ],
run: async (client, interaction, args) => { /**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/ run: async (client, interaction, args) => {
const member = const member =
interaction.guild.members.cache.get(args[0]) || interaction.member; interaction.guild.members.cache.get(args[0]) || interaction.member;
const embed = new EmbedBuilder() const embed = new EmbedBuilder()

View file

@ -2,7 +2,6 @@ const { EmbedBuilder } = require("discord.js");
module.exports = { module.exports = {
name: "ping", name: "ping",
description: "Check bot latency to Discord API", description: "Check bot latency to Discord API",
category: "Information", category: "Information",
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const msg = await interaction.channel.send(`Pinging...`); const msg = await interaction.channel.send(`Pinging...`);

View file

@ -9,7 +9,7 @@ client.on("interactionCreate", async interaction => {
if (!cmd) return; if (!cmd) return;
const args = []; const args = [];
for (const option of interaction.options.data) { for (const option of interaction.options.data) {
if (option.type === "SUB_COMMAND_GROUP") { if (option.type === 2) {
if (option.name) args.push(option.name); if (option.name) args.push(option.name);
option.options?.forEach(x => { option.options?.forEach(x => {
if (x.type === 1) { if (x.type === 1) {
@ -23,7 +23,7 @@ client.on("interactionCreate", async interaction => {
if (x.value) args.push(x.value); if (x.value) args.push(x.value);
}); });
} }
if (option.type === "SUB_COMMAND") { if (option.type === 1) {
if (option.name) args.push(option.name); if (option.name) args.push(option.name);
option.options?.forEach(x => { option.options?.forEach(x => {
if (x.value) args.push(x.value); if (x.value) args.push(x.value);