#Intents error
61 messages · Page 1 of 1 (latest)
I mean right now i have it set as intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
and its showing me this error i looked at the doc which is https://discordjs.guide/popular-topics/intents.html#the-intents-bitfield that but it didnt work still
whats the error
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
^
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (C:\Users\thoma\Desktop\jsbot\index.js:5:23)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47```
code?
ill put it in a browser editor
i dont see intents anywhere
do you have the intents enabled
Yes i do indeed maybe if i restart my laptop maybe that will help
But am very %100 sure that i do have them enabled
why would you restart your laptop
that wont do anything
i dunno because everything looks correct
Yes i did indeed
And you're still getting that error?
That's not how that works, variables defined in code can't just suddenly decide that they have better places to be and just stop working
Are you sure you're running correct code?
That's node version
Not d.js
And that has no rights to cause you this issue either
Your error is about a variable being undefined
Different d.js version won't change anything here
Is it npm list discord.js to find the version of discord.js
I just said that it doesn't matter in the slightest, but yes
"discord.js": "^14.0.0-dev.1655942976-7279f9c",
Again, code claims that the variable is undefined.
It is in v14 isnt it? Moved to IntentsBitfield?
But if not, yeah its just not imported
nvm i guess its been updated
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.Guilds_MESSAGES, GatewayIntentBits.Guilds_MEMBERS]
I want my bot to have intent to send messages
Hello
There no intent for sending messages, intents determine what you receive
Please someone help me with this intent
Error
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
at Function.resolve (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\util\BitField.js:168:11)
at C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\util\BitField.js:163:54
at Array.map (<anonymous>)
at Function.resolve (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\util\BitField.js:163:40)
at Client._validateOptions (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\client\Client.js:481:41)
at new Client (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\client\Client.js:78:10)
at Object.<anonymous> (C:\Users\thoma\Desktop\jsbot\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
[Symbol(code)]: 11
}```
and it is GUILD_MESSAGES or GUILD_MEMBERS
Label shows v13
I did that now but still same error
wait are u in dev or v13
"discord.js": "^14.0.0-dev.1655942976-7279f9c",
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
at Function.resolve (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\util\BitField.js:168:11)
at C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\util\BitField.js:163:54
at Array.map (<anonymous>)
at Function.resolve (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\util\BitField.js:163:40)
at Client._validateOptions (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\client\Client.js:481:41)
at new Client (C:\Users\thoma\Desktop\jsbot\node_modules\discord.js\src\client\Client.js:78:10)
at Object.<anonymous> (C:\Users\thoma\Desktop\jsbot\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
[Symbol(code)]: 11
}```
const fs = require('fs')
const client = new Client({
partials: ["MESSAGE", "CHANNEL", "REACTION"],
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GUILDMESSAGES, GatewayIntentBits.GUILDMEMBERS]
});```
GuildMessages and GuildMembers