21 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!- Websocket intents limit events and decrease memory usage: learn more
- See what intents you need here
Can you show me what intents are you trying to use?
You should have those intents enabled in the application in https://discord.com/developers/applications
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
oh so he did not provide any intents
got it
New problem!!
Fixed dw
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Huh
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
The top line?
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
So should I remove it?
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I now have a new issue
so my bot goes online but it doesn't load commands
it doesn't give any errors either
yes
const { readdirSync } = require('fs');
const { join } = require('path');
const ascii = require('ascii-table');
let table = new ascii("Commands");
table.setHeading("Command", "Load status");
module.exports = (client) => {
const commandsPath = join(__dirname, '..', 'commands');
readdirSync(commandsPath).forEach(dir => {
const commands = readdirSync(join(commandsPath, dir)).filter(file => file.endsWith('.js'));
for (let file of commands) {
let pull = require(join(commandsPath, dir, file));
if (pull.structure && pull.structure.name) {
if (dir === 'prefix') {
if (!pull.run) {
table.addRow(file, '❌ -> missing a run method.');
continue;
}
client.collection.prefixcommands.set(pull.structure.name, pull);
} else {
if (!pull.run) {
table.addRow(file, '❌ -> missing a run method.');
continue;
}
client.collection.interactioncommands.set(pull.structure.name, pull);
client.applicationcommandsArray.push(pull.structure);
}
if (pull.structure.aliases && Array.isArray(pull.structure.aliases)) {
pull.structure.aliases.forEach(alias => {
client.collection.aliases.set(alias, pull.structure.name);
});
}
table.addRow(file, '✅');
} else {
table.addRow(file,
❌ -> missing a structure.name or structure property.
);
}
}
});
//console.log(table.toString());
}
command.js file
everything seems fine
the bot goes online and no errors
THATS THE PROBLEMlast line
I'm a bit new to this
so if u can explain in even more simple terms would be greatly appreciated
yes