GatewayIntentBits.Guilds - Cannot read properties of undefined (reading 'Guilds')
here is exactly everything. I'm following the docs so idk what's wrong. Version and full error images attached.
105 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
yes
Should I restart it?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ok
uh where on the line? sorry ive never used that
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ok a screen came up, what information is important?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
no
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
GatewayIntentBits is not underlined. Only the word require is. I thought that's what it was
when i hover it it only says import gatewayintentbits
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
yes
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
wait the import doesn't underline it, just the client when I define it. I'm sorry
Nothing in the const {} = require("discord.js") underlines with the ctrl key + hover
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
this?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
that shouldnt be necessary on v14
i think discord js hates me
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Whats line 51 of llama.js
Thats where it appears to be coming from
GatewayIntentBits.GuildMembers
ima just get rid of that rq
Is that the file you showed earlier?
It didnt look like intents were 51 lines deep
it's in the file, should be
Oh I have some comments for myself
i took them out to make it a bit shorter
np
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ok if I import them all separately I get a different error
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I tried it like this
thats definitely completely wrong
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
You cant require discord.js as three different things
You're not destructuring anymore
well then that would be that error. dang it
It was right before
Yeah I got it from the docs, I was just trying it
(I changed it back)
actually can you try
npm ls discord-api-types
You should get 0.36.2 nested under discord.js in a few placesdunno what all this is but side note I've uninstalled builders as per the docs
npm uninstall @discordjs/builders
that all looks correct
The top level install isnt necessary but wouldnt break anything
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
If you right click the import and click Go To Definition does that work?
no definition found for Gateway intent bits
that seems... problematic
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
At this point
so that's the problem, but why doesn't it is the answer?
Uninstall and reinstall discord.js and restart VSC lol
I've done that a few times but I will again in that order
Actually wait
Uninstall whatever that
discord
module isUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
I dont see where thats being used
where?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
This shows
"discord": "^0.8.2"
oh got it
No idea what that is
Also js?
tbh... me either
Seems like you accidentally did
npm i discord js
at some point
Remove those, give VSC a restart and let me knowstill getting that error
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
yes
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
install all my packages again you mean? Like npm i cron, discord.js, mongodb all that
just so I don't do something catastrophic
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ok
it's asking if I want to permanently delete the folders and files. This seems important so I want to be sure. Delete them?
if its just node_modules yes
You can safely delete that and reinstall
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ok yup that's what I had
If that still doesnt work, please give me ALL the code and I'll take a look, see if I can replicate the error
Actually wait wait
The error path shows /root/discord/llama.js
But here this looks like you're not in the
discord
folder
I think that shouldnt matter but its still a bit weirdlet me finish with the node modules folder and ill get on that
Really still just this at this point
its just taking a while to delete,
ok now lets try
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
After npm i................ same error. by full code what do you mean? Everything else in that file is a comment
yeah, but removing them messes up line numbers so its harder for me to diagnose
ah sorry. I can get that but also the node Modules folder didn't reappear
does it just take a bit?
When you ran npm i?
yes
Yeah this makes me extra sure you've been running commands in the wrong directory
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
the node modules folder was not in the discord folder just for info
ty for helping mittel I really appreciate it. Have a good night!
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
hopefully. I won a bid for an ad on top gg and already paid...
Yeah that seems like the problem then
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
They were installed at the wrong level
Should I do that again the correct place? Where would that be
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
cd discord
npm i
The node modules folder did appear but I can't tell if there was always one in discord. There was one in root which is what I thought was the only one
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
regardless of that sorry to be a wet blanket or whatever but... the error persists
I would have thought it belongs in discord but I really have no idea what your project structure is anymore
Let me try some things. I think I see whats wrong
I'd need a screenshot of your folder structure in VSC, and all the code of llama.js
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Ok I fixed it. I believe a while ago I forgot to cd into discord and created a node modules folder. Today I installed v14 to that, not the one in discord. I updated discordjs while cd into discord and the error went away, I just have to update all the other v 14 stuff
Those thick yellow lines are hiding things lol
Okay cool, great
Glad we got there
Basically I was really stupid. I'm super sorry for wasting ur time but thank you so much for helping and walking me through it(both of you)
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
so that is inside the
discord
folder
Yeah thanks, looks right that you should be working in thereYeah I just updated the discord folder one. instead of outside that
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Very hard to spot tiny issues like that in error stacks etc
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View