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 toolkit5mo 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
gone ^^
gone ^^OP5mo ago
No description
space
space5mo ago
Most likely because you don't have the message content intent enabled.
gone ^^
gone ^^OP5mo ago
I tried enabling all intents by doing this but i guess i shouldn't do this..?
No description
space
space5mo 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
Trifle5mo 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
gone ^^
gone ^^OP5mo ago
im also making user app commands so should i just use the normal intents instead of a magic number
space
space5mo ago
Yeah
gone ^^
gone ^^OP5mo ago
alr give me a sec
gone ^^
gone ^^OP5mo ago
so i guess this should be fine?
No description
gone ^^
gone ^^OP5mo ago
okay yeah it's working awesome
space
space5mo ago
👍
gone ^^
gone ^^OP5mo 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
gone ^^
gone ^^OP5mo ago
No description
gone ^^
gone ^^OP5mo ago
messages aren't going through
space
space5mo ago
Yes, I think you need to enable the channel partial for that.
gone ^^
gone ^^OP5mo ago
channel partial?
gone ^^
gone ^^OP5mo ago
do i have to put it somewhere here or
No description
space
space5mo 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:
gone ^^
gone ^^OP5mo ago
Interesting why's this btw on other libraries that i've seen it just detects the message right away
gone ^^
gone ^^OP5mo ago
huh
No description
No description
gone ^^
gone ^^OP5mo ago
nothing's coming up
gone ^^
gone ^^OP5mo ago
No description
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs5mo ago
To receive direct message events on "messageCreate" with your bot, you will need: - The DirectMessages gateway intent - The Channel partial setting
space
space5mo ago
There it went
gone ^^
gone ^^OP5mo ago
Ohhh okay now it works thanks :33
Want results from more Discord servers?
Add your server