Ready event randomly stopped working

Does Discord have issues? Until a few hours ago my bot worked completely fine and have been for several months, but now it suddenly stopped triggering ready events?
3 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Iced Queen
Iced QueenOP2y ago
Well commands work, but I'm trying to send a message in a ready event, which is now wont In an event file in my events folder.
module.exports = {
name: 'ready',
once: true,
async execute(client) {
module.exports = {
name: 'ready',
once: true,
async execute(client) {
I'm trynna send a message in here, but it wont. Wdym? Do you mean my event handler?
module.exports = (client) => {
client.handleEvents = async (eventFiles) => {
for (const file of eventFiles) {
const event = require(`../events/${file}`);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client));
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
}
};
}
module.exports = (client) => {
client.handleEvents = async (eventFiles) => {
for (const file of eventFiles) {
const event = require(`../events/${file}`);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client));
} else {
client.on(event.name, (...args) => event.execute(...args, client));
}
}
};
}
const functions = fs.readdirSync("./src/functions").filter(file => file.endsWith(".js"));
const eventFiles = fs.readdirSync("./src/events").filter(file => file.endsWith(".js"));
const commandFolders = fs.readdirSync("./src/commands");

(async () => {
for (file of functions) {
require(`./functions/${file}`)(client);
}
client.handleEvents(eventFiles, "./src/events");
client.handleCommands(commandFolders, "./src/commands");
client.login(token.token);
})().catch(console.error.red);
const functions = fs.readdirSync("./src/functions").filter(file => file.endsWith(".js"));
const eventFiles = fs.readdirSync("./src/events").filter(file => file.endsWith(".js"));
const commandFolders = fs.readdirSync("./src/commands");

(async () => {
for (file of functions) {
require(`./functions/${file}`)(client);
}
client.handleEvents(eventFiles, "./src/events");
client.handleCommands(commandFolders, "./src/commands");
client.login(token.token);
})().catch(console.error.red);
So I need await before both client.handleEvents and client.handleCommands?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server