#help me please
1 messages · Page 1 of 1 (latest)
so how should I do it?
const Command = require("../structure/Command");
const { Client, Message } = require("discord.js");
class Ping extends Command {
constructor() {
super({
name: "ping",
description: "Permet de connaître les informations réseaux du bot"
})
}
/**
* @param {Client} client
* @param {Message} message
* @param {string[]} args
*/
async execute(client, message, args) {
message.channel.sendTyping();
await message.channel.send(`${emojis.mysaki_loading} Chargement en cours...`).then((result) => {
let latency = result.createdTimestamp - message.createdTimestamp;
const pingEmbed = new MessageEmbed()
.setColor("RED")
.setTitle(`${emojis.mysaki_information} Information réseau du bot`)
.addField(`${emojis.mysaki_ping} Ping du bot : `, `${this.ws.ping}ms`)
.addField(`${emojis.mysaki_latency} Latence de l'API de Discord : `, `${latency}ms`)
result.edit({ embeds: [pingEmbed], content: " " });
})
}
}
module.exports = Ping;
my code
@silent crow
If that's the code with the problem, then Command is undefined
Because first line doesn't work, due circular dependency
It's a JS related issue
and then I do how to settle it?
Do you even know what circular dependency is?
no
Then search on Google, because there's lot to explain, and it may require you make lots of code changes
even searching on the internet I can't solve the problem
Because it is a type of problems, you have to understand it
1 min of read is nowhere near
You're lucky it had nothing to do with circular dependency