Message content is empty, unless the bot is tagged

The message content field will always be blank, regardless, unless I mention the bot. Why's this?
No description
No description
27 Replies
d.js toolkit
d.js toolkit3mo ago
- 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! - Marked as resolved by OP
Furro
Furro3mo ago
No description
space
space3mo ago
Most likely because you don't have the message content intent enabled.
Furro
Furro3mo ago
I tried enabling all intents by doing this but i guess i shouldn't do this..?
No description
space
space3mo ago
You definitely should not paste a magic number there. You should only enable what you need (guilds as minimum, since discord.js needs that if you interact with guilds)
Trifle
Trifle3mo ago
Bot status
This bot has been running for approximately 7 seconds
This bot has been running for approximately 7 seconds
Just a Discord bot written in JavaScript using discord.js :3
System info
CPU cores: 24
Platform: Furreto Linux linux (6.9.1-arch1-furretokrnl #1 SMP PREEMPT_DYNAMIC Thu, 23 May 2024 11:28:50 +0000)
Memory: 24.70 GB / 31.11 GB
CPU cores: 24
Platform: Furreto Linux linux (6.9.1-arch1-furretokrnl #1 SMP PREEMPT_DYNAMIC Thu, 23 May 2024 11:28:50 +0000)
Memory: 24.70 GB / 31.11 GB
API Latency
Latency: 83.79ms
Latency: 83.79ms
Library
NodeJS version: v22.4.1
Library: discord.js
NodeJS version: v22.4.1
Library: discord.js
Called by furretpaws
Furro
Furro3mo ago
im also making user app commands so should i just use the normal intents instead of a magic number
space
space3mo ago
Yeah
Furro
Furro3mo ago
alr give me a sec
Furro
Furro3mo ago
so i guess this should be fine?
No description
Furro
Furro3mo ago
okay yeah it's working awesome
space
space3mo ago
👍
Furro
Furro3mo ago
i have another question tho, is there a way so the bot detects dms without having to actually open a dm to the user first
No description
Furro
Furro3mo ago
No description
Furro
Furro3mo ago
messages aren't going through
space
space3mo ago
Yes, I think you need to enable the channel partial for that.
Furro
Furro3mo ago
channel partial?
Furro
Furro3mo ago
do i have to put it somewhere here or
No description
space
space3mo ago
Yeah, it's another option, like intents is: https://discordjs.guide/popular-topics/partials.html#handling-partial-data I don't recall if we had something written for receivin dms :jynEHEH:
Furro
Furro3mo ago
Interesting why's this btw on other libraries that i've seen it just detects the message right away
Furro
Furro3mo ago
huh
No description
No description
Furro
Furro3mo ago
nothing's coming up
Furro
Furro3mo ago
No description
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3mo ago
To receive direct message events on "messageCreate" with your bot, you will need: - The DirectMessages gateway intent - The Channel partial setting
space
space3mo ago
There it went
Furro
Furro3mo ago
Ohhh okay now it works thanks :33
Want results from more Discord servers?
Add your server