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 toolkit16mo 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
ryllixOP16mo ago
i want to start the bot
space
space16mo 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/luna16mo ago
Also, you tagged this post v14 but thats v13 Nor will that code work since you miss the MessageContent intent
ryllix
ryllixOP16mo ago
The top one?
ryllix
ryllixOP16mo ago
It has this In it ???
treble/luna
treble/luna16mo ago
You need the MessageContent intent to access message.content also why do you have 2 index files
ryllix
ryllixOP16mo ago
Idk Cuz the tutorial I deleted the bottom one Is that good?
treble/luna
treble/luna16mo ago
I dont know where your code is so i dont know
ryllix
ryllixOP16mo ago
The code for starting it is in the top one
treble/luna
treble/luna16mo ago
then run that one
ryllix
ryllixOP16mo ago
treble/luna
treble/luna16mo ago
.
ryllix
ryllixOP16mo ago
So?
treble/luna
treble/luna16mo ago
Update it
ryllix
ryllixOP16mo ago
Oh okay And then it should work?
treble/luna
treble/luna16mo ago
If you add the MessageContent yes And also enable it in the dev portal
ryllix
ryllixOP16mo ago
Where do I add that Oh k
treble/luna
treble/luna16mo ago
In your constructor
ryllix
ryllixOP16mo ago
d.js docs
d.js docs16mo ago
guide Home: What's new read more
ryllix
ryllixOP16mo ago
What is that
treble/luna
treble/luna16mo ago
Do you have any experience with js?
ryllix
ryllixOP16mo ago
Like a little bit
treble/luna
treble/luna16mo ago
Djs requires a strong js understanding
ryllix
ryllixOP16mo ago
How do I update it?
d.js docs
d.js docs16mo ago
guide Additional Information: Updating from v13 to v14 read more
ryllix
ryllixOP16mo ago
Btw I’m sorry for my annoying lack of iq Idk Do I need to read that?
treble/luna
treble/luna16mo ago
if you want your code to work, yes
ryllix
ryllixOP16mo ago
… It’s a code from YouTube tutorial
treble/luna
treble/luna16mo ago
follow the guide YouTube tutorial outdate almost instantly
ryllix
ryllixOP16mo ago
Yeah Can you please just send me the code that activates it?
treble/luna
treble/luna16mo ago
#rules 5 just replace intents.flags with GatewayIntentBits
ryllix
ryllixOP16mo ago
That’s it?
treble/luna
treble/luna16mo ago
yes
ryllix
ryllixOP16mo ago
Can’t read properties of undefined (reading flags)
treble/luna
treble/luna16mo ago
show your code
ryllix
ryllixOP16mo ago
I’m either stupid or blind
treble/luna
treble/luna16mo ago
Its PascalCase And reset your token And you're missing the MessageContent intent
ryllix
ryllixOP16mo ago
Pascal what?
d.js docs
d.js docs16mo 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
ryllixOP16mo ago
So I need the perms and that’s it?
treble/luna
treble/luna16mo ago
the intents* And reset your token
ryllix
ryllixOP16mo 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/luna16mo ago
define doesnt work
ryllix
ryllixOP16mo ago
The flags errror
treble/luna
treble/luna16mo ago
did you save your code
ryllix
ryllixOP16mo ago
Bruh I didn’t Now it’s saying code:BitFieldValid
treble/luna
treble/luna16mo ago
show your code but I suspect its this yep, read the tag again also your ready event emits a client parameter
ryllix
ryllixOP16mo ago
Wut
ryllix
ryllixOP16mo ago
This?
treble/luna
treble/luna16mo ago
yes
ryllix
ryllixOP16mo ago
OMG IM SO SMART BitFieldInvalid What’s wrong now? I saved it
treble/luna
treble/luna16mo ago
show your code
ryllix
ryllixOP16mo ago
Bruh why do I look black
treble/luna
treble/luna16mo ago
still didnt fix it GUILDS -> Guilds, GUILD_MESSAGES -> GuildMessages Its PascalCase, not SCREAMING_SNAKE
ryllix
ryllixOP16mo ago
Done HWBDHSBA ITS WORKING TYSM TYSM! Wooo! So do I type the scripts for the bot under it?
treble/luna
treble/luna16mo ago
yes the guide explains how to create a command and event handler
ryllix
ryllixOP16mo ago
I have a warning system ready he isnt talking to me
treble/luna
treble/luna16mo ago
?
Sergz
Sergz16mo 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
Sergz16mo 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
Want results from more Discord servers?
Add your server