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 toolkit12mo 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
ashie12mo ago
C:\Users\\IdeaProjects\LFTbot>npm list discord.js
lftbot@1.0.0 C:\Users\\IdeaProjects\LFTbot
`-- discord.js@14.11.0
C:\Users\\IdeaProjects\LFTbot>npm list discord.js
lftbot@1.0.0 C:\Users\\IdeaProjects\LFTbot
`-- discord.js@14.11.0
my node version is v18.12.1 adding GatewayIntentBits.MessageContent to the intents has not seemed to help
duck
duck12mo ago
you will need that intent to receive message content but the event is named messageCreate in v14
ashie
ashie12mo 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
ashie12mo ago
Gist
gist.js
GitHub Gist: instantly share code, notes, and snippets.
duck
duck12mo 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
ashie12mo ago
just over 400 😭 but its in like groups not all at once
duck
duck12mo ago
that still sounds a little spammy