messages not being read?

hello! i have the following code and when i use the command it does not run the code under it, so i added the line to log any messages captured by the bot and none are being found! the bot is online and running in the server https://gist.github.com/ash-development/70cdf741dd81efaf8c147f011790db50
Gist
index.js
GitHub Gist: instantly share code, notes, and snippets.
8 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
ashie
ashieOP2y ago
C:\Users\\IdeaProjects\LFTbot>npm list discord.js
[email protected] C:\Users\\IdeaProjects\LFTbot
C:\Users\\IdeaProjects\LFTbot>npm list discord.js
[email protected] C:\Users\\IdeaProjects\LFTbot
my node version is v18.12.1 adding GatewayIntentBits.MessageContent to the intents has not seemed to help
duck
duck2y ago
you will need that intent to receive message content but the event is named messageCreate in v14
ashie
ashieOP2y ago
ah tysm!! its registering the messages now but im running into some issues it is sending the channel message saying its assigned the role but its not logging it into the console or actually giving the role
ashie
ashieOP2y ago
Gist
gist.js
GitHub Gist: instantly share code, notes, and snippets.
duck
duck2y ago
depending on how many members you attempt to add a role to, this could potentially get api spammy but that aside, members aren't cached by default you can fetch a guild's members with <Guild>.members.fetch() (this only needs to be done once) you'll also need the GuildMembers intent
ashie
ashieOP2y ago
just over 400 😭 but its in like groups not all at once
duck
duck2y ago
that still sounds a little spammy
Want results from more Discord servers?
Add your server