Cykz
Cykz
DIAdiscord.js - Imagine an app
Created by Cykz on 10/27/2023 in #djs-questions
client undefined
I got this code to emit a custom event in my database manager class :
console.log(this.client); <== works
this.client.emit('squadronPointsUpdate', {
squadronStats: squadronStats,
players: players,
client: this.client
});
console.log(this.client); <== works
this.client.emit('squadronPointsUpdate', {
squadronStats: squadronStats,
players: players,
client: this.client
});
It correctly logs the client in console but in my event class it logs undefined and I don't understand why
module.exports = {
name: 'squadronPointsUpdate',
async execute(squadronStats, players, client) {
console.log("\n\n")
console.log(client) <== not working "undefined"
console.log("\n\n")
console.log("hhhh")
}
module.exports = {
name: 'squadronPointsUpdate',
async execute(squadronStats, players, client) {
console.log("\n\n")
console.log(client) <== not working "undefined"
console.log("\n\n")
console.log("hhhh")
}
10 replies
DIAdiscord.js - Imagine an app
Created by Cykz on 10/18/2023 in #djs-questions
creating custom events
Hello how can I create custom events and call them from another file ?
4 replies
DIAdiscord.js - Imagine an app
Created by Cykz on 10/17/2023 in #djs-questions
Need help handling event
No description
7 replies
DIAdiscord.js - Imagine an app
Created by Cykz on 9/25/2023 in #djs-questions
Simplifying embed usage
Hi, I'm wondering if there is a way to not repeat the full embed builder every time I need an embed ? I already thought about a function in another class but I dont know how it should looks like
13 replies