#very simple Problem with Intents.FLAGS.GUILDS but cant find

1 messages · Page 1 of 1 (latest)

mighty beacon
#

i watched many tutorials and went on many websites and often they had the exact same code here but it doesnt work for me

sinful yarrow
#

you misspelled GUILDS

mighty beacon
#

wait wait

tidal flame
mighty beacon
#

i jsut changed that i thought i missspelled GUILD so iu changed it to GUILD because it gave me some bitmap error

#

and then it ave me this one

tidal flame
#

What's Intents defined as?

mighty beacon
#

you mean this?

#

const Intents = require('discord.js');

tidal flame
#

Yea, that's wrong

sinful yarrow
#

do Intents.Intents

mighty beacon
#

what but i strsaight up copied that

tidal flame
#

No blobstop

sinful yarrow
#

or destructure

tidal flame
#

@sinful yarrow Please give good advice not bad advice

mighty beacon
#

hahaha

sinful yarrow
#

that will work trust me

tidal flame
#

@mighty beacon Rename your import to Discord or DJS

tidal flame
mighty beacon
tidal flame
#

@mighty beacon
You want either:

const Discord = require('discord.js');
const { Intents } = Discord;

Or if you don't need the whole import, just

const { Intents } = require('discord.js');
mighty beacon
#

oh i have const Discord as well but intents without the brackets

#

just had it like this

tidal flame
#

There you go

#

Implement my first suggestion's, second line

mighty beacon
#

well

#

another problem

tidal flame
#

🤨

mighty beacon
#

wait i gotta figure something out

tidal flame
#

Ping me on your return.
I'm working, but might see it

mighty beacon
#

so i have this

#

but now theres some bitfield problem

tidal flame
#

Look at your 3rd line, same problem

mighty beacon
#

so this would be right?

#

const { Client , Intents } = Discord;

merry berry
#

discord.js doesn't have a default export. by not restructuring your imports you're just importing the same thing, just redefined

merry berry
mighty beacon
#

i had that before it gives the same error it must be something else

tidal flame
merry berry
#

that too dogeHaHa

mighty beacon
#

i forgot xD

lunar ether
mighty beacon
#

its been a while that i programmed

#

a shit

#

its doing something

#

okay so it said bot is ready so the first part worked

#

this isnt as simple as i thought...

#

but as soon as i use one of my commands that i have

#

wait

tidal flame
#

Just follow the guide.
And brush up on JavaScript
#rules 2️⃣

mighty beacon
#

sorry i overestimated myself and underestimated the problem

#

thanks anyways you guys helped a lot

tidal flame
#

NP, best of luck.

mighty beacon
#

how do i close the thread?

#

hm