GatewayIntentBits seen as index.js property
Hi, I updated my discord.js to version @14.11 and wanted to update my intents, but somehow,
GatewayIntentBits
is seen as property of index.js and not if discord.js which means that i cant import Intents. Has anybody a solution for this?
Code:
51 Replies
• 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.Updated the IDE,restarted it but still same result...
What do you mean by seen as a property of index.js?
it doesn't get recognized as part of discord.js ergo i can't define intents ergo my Bot can't send messages
I'm confused, does it say that or error in the console?
No. just when i type i can see that it's porperty from index.js and intents don't get highlighted properly
but there's no error in the console
What IDE are you using?
I tried it in IntelliJ and in VCS
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Output from both IDEs
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It just doesn't recognize GatewayIntentBits as part of discord.js but as part of index.js ergo i can't define the Intents
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
therefore
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Hope this pictures help understanding the problem
i deleted GatewayIntentBits right before i took the screenshot and forgot to also delete the comma
As you can see, VCS just shows it to me as a string and IntelliJ says it's property of index.js
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
No there are no errors in the console
you think? I mean it should work properly in at least one of the IDEs
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
my Bot starts but doesn't reply to commands
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
both, prefix and slash
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yes, and i reinstalled discord.js
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yeah did this with VCS, shows me right syntax now but somehow still doesn't send messages
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
still no syntax error as before
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
i can, it's pretty long though
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Pastebin
Code - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Both don't send, slash commands might be bc they're not updated by now, but the messageCreate should be up do date as far as i'm concerned
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
yeah i put a log between the Event and the statement. Event gets triggered
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
If you aren't getting any errors, try to place
console.log
checkpoints throughout your code to find out where execution stops.
• Once you do, log relevant values and if-conditions
• More sophisticated debugging methods are breakpoints and runtime inspections: learn more
seems like this is the problem
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
okay, i took the command handler form the discord.js guide and this are the errors:
but i have data and execute in my help.js file :/
yes with module.export
that's how I export the commands
Missing a required data property, you're requiring the wrong commands
That warning should be for a slashcommand
But it doesn’t work either when i use
And so on
Did you do this for all your other commands?
And you have both data and execute properties
No only for the help command as its the only one im testing rn
Show the handler
Hope you understand it since my code is really messy rn
Its basically the handler from the discord.js guide
no not anymore, but one of the errors gets triggered bythe help command
i think I also mentioned it earlier in the thread
this is the whole output