#idk how to fix it

49 messages · Page 1 of 1 (latest)

wet coveBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • 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!
simple field
#

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)

glad ravine
#

Also, you tagged this post v14 but thats v13

#

Nor will that code work since you miss the MessageContent intent

glad ravine
#

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

glad ravine
#

Update it

#

If you add the MessageContent yes

#

And also enable it in the dev portal

#

In your constructor

bleak emberBOT
glad ravine
#

Do you have any experience with js?

#

Djs requires a strong js understanding

bleak emberBOT
#

guide Additional Information: Updating from v13 to v14
read more

glad ravine
#

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

bleak emberBOT
#

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
glad ravine
#

the intents*

#

And reset your token

#

define doesnt work

#

did you save your code

#

show your code

glad ravine
#

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

glad ravine
#

?

modern kernel
#

@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.

meager drift
modern kernel
#

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