idk how to fix it

i just need help. also idk how to see what version it is.
63 Replies
d.js toolkit
d.js toolkit2y ago
- 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!
ryllix
ryllixOP2y ago
i want to start the bot
space
space2y ago
You showed src/index.js, but started index.js. You seem to have two, this likely is a mistake. Try node src/index.js (and deleting the top level index.js after confirming you don't want anything from there)
treble/luna
treble/luna2y ago
Also, you tagged this post v14 but thats v13 Nor will that code work since you miss the MessageContent intent
ryllix
ryllixOP2y ago
The top one?
ryllix
ryllixOP2y ago
It has this In it ???
treble/luna
treble/luna2y ago
You need the MessageContent intent to access message.content also why do you have 2 index files
ryllix
ryllixOP2y ago
Idk Cuz the tutorial I deleted the bottom one Is that good?
treble/luna
treble/luna2y ago
I dont know where your code is so i dont know
ryllix
ryllixOP2y ago
The code for starting it is in the top one
treble/luna
treble/luna2y ago
then run that one
ryllix
ryllixOP2y ago
treble/luna
treble/luna2y ago
.
ryllix
ryllixOP2y ago
So?
treble/luna
treble/luna2y ago
Update it
ryllix
ryllixOP2y ago
Oh okay And then it should work?
treble/luna
treble/luna2y ago
If you add the MessageContent yes And also enable it in the dev portal
ryllix
ryllixOP2y ago
Where do I add that Oh k
treble/luna
treble/luna2y ago
In your constructor
ryllix
ryllixOP2y ago
d.js docs
d.js docs2y ago
guide Home: What's new read more
ryllix
ryllixOP2y ago
What is that
treble/luna
treble/luna2y ago
Do you have any experience with js?
ryllix
ryllixOP2y ago
Like a little bit
treble/luna
treble/luna2y ago
Djs requires a strong js understanding
ryllix
ryllixOP2y ago
How do I update it?
d.js docs
d.js docs2y ago
guide Additional Information: Updating from v13 to v14 read more
ryllix
ryllixOP2y ago
Btw I’m sorry for my annoying lack of iq Idk Do I need to read that?
treble/luna
treble/luna2y ago
if you want your code to work, yes
ryllix
ryllixOP2y ago
… It’s a code from YouTube tutorial
treble/luna
treble/luna2y ago
follow the guide YouTube tutorial outdate almost instantly
ryllix
ryllixOP2y ago
Yeah Can you please just send me the code that activates it?
treble/luna
treble/luna2y ago
#rules 5 just replace intents.flags with GatewayIntentBits
ryllix
ryllixOP2y ago
That’s it?
treble/luna
treble/luna2y ago
yes
ryllix
ryllixOP2y ago
Can’t read properties of undefined (reading flags)
treble/luna
treble/luna2y ago
show your code
ryllix
ryllixOP2y ago
I’m either stupid or blind
treble/luna
treble/luna2y ago
Its PascalCase And reset your token And you're missing the MessageContent intent
ryllix
ryllixOP2y ago
Pascal what?
d.js docs
d.js docs2y ago
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined - All SCREAMING_SNAKE_CASE enums have been changed to PascalCase - Intents: Intents.FLAGS.GUILD_MESSAGES -> GatewayIntentBits.GuildMessages - Permissions: Permissions.FLAGS.SEND_MESSAGES -> PermissionFlagsBits.SendMessages
ryllix
ryllixOP2y ago
So I need the perms and that’s it?
treble/luna
treble/luna2y ago
the intents* And reset your token
ryllix
ryllixOP2y ago
It was on Bruh I forgot to give the bot permissions My iq if under the floor Bruh still doesn’t work
treble/luna
treble/luna2y ago
define doesnt work
ryllix
ryllixOP2y ago
The flags errror
treble/luna
treble/luna2y ago
did you save your code
ryllix
ryllixOP2y ago
Bruh I didn’t Now it’s saying code:BitFieldValid
treble/luna
treble/luna2y ago
show your code but I suspect its this yep, read the tag again also your ready event emits a client parameter
ryllix
ryllixOP2y ago
Wut
ryllix
ryllixOP2y ago
This?
treble/luna
treble/luna2y ago
yes
ryllix
ryllixOP2y ago
OMG IM SO SMART BitFieldInvalid What’s wrong now? I saved it
treble/luna
treble/luna2y ago
show your code
ryllix
ryllixOP2y ago
Bruh why do I look black
treble/luna
treble/luna2y ago
still didnt fix it GUILDS -> Guilds, GUILD_MESSAGES -> GuildMessages Its PascalCase, not SCREAMING_SNAKE
ryllix
ryllixOP2y ago
Done HWBDHSBA ITS WORKING TYSM TYSM! Wooo! So do I type the scripts for the bot under it?
treble/luna
treble/luna2y ago
yes the guide explains how to create a command and event handler
ryllix
ryllixOP2y ago
I have a warning system ready he isnt talking to me
treble/luna
treble/luna2y ago
?
Sergz
Sergz2y ago
@ryllix A friendly tip. Before you get into any discord bot creation, get familiar with computer science, programming. Just the basics. Learn about logic, etc. Then, learn JavaScript. After you have good fundamental knowledge of JS, go on to using different libraries such as discord.js. I know it sounds harsh, but if you can’t get the most basic thing done, you won’t be able to make anything else. You will only make yourself more frustrated, and demotivated to learn further.
Булочка | pasha_boez
Its not always so
Sergz
Sergz2y ago
I think it’s pretty good advice. My time on this discord server doesn’t correlate to my knowledge and experience. I’m pretty sure even the official guide for discord js says to get familiar with JS first

Did you find this page helpful?