- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- 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!
#idk how to fix it
49 messages · Page 1 of 1 (latest)
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)
Also, you tagged this post v14 but thats v13
Nor will that code work since you miss the MessageContent intent
You need the MessageContent intent to access message.content
also why do you have 2 index files
I dont know where your code is so i dont know
then run that one
.
Update it
If you add the MessageContent yes
And also enable it in the dev portal
In your constructor
if you want your code to work, yes
follow the guide
YouTube tutorial outdate almost instantly
#rules 5
just replace intents.flags with GatewayIntentBits
yes
show your code
Its PascalCase
And reset your token
And you're missing the MessageContent intent
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined
- All
SCREAMING_SNAKE_CASEenums have been changed toPascalCase - Intents:
Intents.FLAGS.GUILD_MESSAGES->GatewayIntentBits.GuildMessages - Permissions:
Permissions.FLAGS.SEND_MESSAGES->PermissionFlagsBits.SendMessages
the intents*
And reset your token
define doesnt work
did you save your code
show your code
but I suspect its this
yep, read the tag again
also your ready event emits a client parameter
yes
show your code
still didnt fix it
GUILDS -> Guilds, GUILD_MESSAGES -> GuildMessages
Its PascalCase, not SCREAMING_SNAKE
yes
the guide explains how to create a command and event handler
?
@atomic latch 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.
Its not always so
A friendly tip: don't let your first message in a coding server be telling someone else what they should do to be able to code...
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
Home: What's new