intents issue
so this is my code const { token, default_prefix, color } = require("./config.json");
const Discord = require("discord.js");
require("@haileybot/sanitize-role-mentions");
const client = new Discord.Client({
disableMentions: "everyone",
fetchAllMembers: true,
partials: ['MESSAGE', 'REACTION'],
intents: [
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.MessageContent,
],
});
const mongoose = require('mongoose')
/mongoose.connect('mongo url', {
useUnifiedTopology: true,
useNewUrlParser: true
}).then(console.log('connected to mongoose'))/
const jointocreate = require("./jointocreate");
jointocreate(client);
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
client.db = require("quick.db");
module.exports = client;
["command", "event"].forEach(handler => {
require(
./handlers/${handler}
)(client);
});
Discord.Constants.DefaultOptions.ws.properties.$browser = "Discord Android"
client.login(token)
and it's giving me this error15 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!what is your djs version? you selected multiple versions using the tags
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
13
your exact version
- What's your exact discord.jsnpm list discord.js
and nodenode -v
version?
Then why add v14 tag? GatewayIntentBits is for v14
Use this ^
ok
it's not 13 its 12.3.5
djs v12 is no longer supported
okay
13.6.0 is supported right
yes
is it a stable option to choose to upgrade to
i would recommend using 13.17.1 if you really want to use v13
or just update to the latest v14 version
ok