63 Replies
- 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!"discord.js": "^14.13.0"
you do not have the GuildMessages and/or MessageContent intent
when I put GuildMessages or MessageContent it shows error on my terminal
then you have to enable the intent in the developer portal
do you mean this one
the message content one yes
still doesnt work
restarted the bot and turned the message content to on
define does not work
did you add the intents
to your client constructor
okay now it works
and how are you listening for messages
when I use the IntentsBitField.GuildMessages it throws error
throw new DiscordjsRangeError(ErrorCodes.BitFieldInvalid, bit);
^
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
npm ls discord.js
Didnt send that code jajajaaja
already installed?
thats not what i'm asking
just run the command
what does it do
it lists the version of djs you are using
did you save your code
yes mam
can you show the full error stack
also
wait
why are you using GatewayIntentBits but telling me you use IntentsBitField
well yeah, IntentsBitField.GuildMessages is indeed undefined
when I used IntentsBitField it gave the above eror
i dont see why you are using both GatewayIntentBits and IntentBitsField
are both the same
if you use it correclty, yes
either use GatewayIntentBits.GuildMessages, like you did before
okay
or intentsbitfields but you have to put Flags first
which then returns GatewayIntentBits regardless
Idk whats a Flag is it a boolean
its a property
just use GatewayIntentBits
okay thanks
one more error
cannot use import out a module
thats not really djs realted, either change to require()
I have "type":"module" in my package.json
yeah not djs related anymore at this point
client is the bot and guild is the server right
yes
Im trying to run the commands file
do i run it npm run start commands.js
those are 3 scripts
either run node <yourfile>
or create a script and run that script
how do I do that
I did this
and what did it output
you also ran it before
so just run the same command you ran before
node commands.js
Started refreshing application (/) commands.
Successfully reloaded application (/) commands.
thats to deploy your commands
im confused now
I have 2 files index.js and commands.js
that is indeed correct
your command.js file is just to deploy your commands
your index is your main file
yes
do you have an event handler
nope
gotta make one
also why does your account reply with the interaction failed message lol
you shld say Idk lol
im getting again module error
@wolvinny 🌈
and it again is not djs related
again now its not working
define not working
this is my code
its not reading inpt
have this turned on too
and has your bot logged in
yes
its online
intents dont matter here
do you run a slash command
yes
okay wait how can I make the bot respond to a chat when someone send helo
<Interaction>.reply()
I added a new command and it was succesfully uploaded
but its not showing
refresh your discord