discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.95k stars 1.26k forks source link

Bot isn't getting message content even though the intent is turned on (API v10) #4775

Closed SammyWhamy closed 2 years ago

SammyWhamy commented 2 years ago

Description

I have 4 bots created, all of them are currently in 1 server, got created the same day and all have only the limited message intent turned on (Flags 524288).

When making this request: curl -H "Authorization: Bot ****" https://discord.com/api/v10/channels/963224728607272990/messages/963226571777380393 once with every bot token, 2 bots get the message content in the response, while the other 2 get an empty message content field.

Even weirder is that when I replace the message ID 963226571777380393 with 963224730192715796, 3 bots aren't getting the content while 1 is.

The content of both messages is just text, no mentions, with the second message ID even the bot that sent that message cannot retrieve the content of its own message.

Steps to Reproduce

I'm not sure at all if this is reliably reproducible, especially since even these 4 bots have differing results based on the messages I'm trying to fetch, but this is what I did.

Expected Behavior

All 4 bots get the message content in the response as long as the intent is enabled in the portal

Current Behavior

Only 1 or 2 bots get the message content, even though all 4 have the intent enabled in the portal

Screenshots/Videos

No response

Client and System Information

I'm simply making a GET request through curl in the windows command prompt.

OS Name: Microsoft Windows 10 Pro Version: 10.0.19044 Build 19044

I first noticed this issue using Discord.js 14.0.0-dev.1649505803-3c0bbac However the exact same issue is seen through curl

night commented 2 years ago

Do you have the list of application ids exhibiting this behavior? The only identifiers provided have all been deleted.

SammyWhamy commented 2 years ago

Do you have the list of application ids exhibiting this behavior? The only identifiers provided have all been deleted.

Message I'm trying to fetch: https://canary.discord.com/channels/957370416068956210/963475828874834020/963476012920881232

Curl request: curl -H "Authorization: Bot **" https://discord.com/api/v10/channels/963475828874834020/messages/963476012920881232

Bot IDs: 957370792553877525 -> not getting content 957370840163434516 -> not getting content 957370904189468763 -> getting content 957370942529618030 -> getting content

onerandomusername commented 2 years ago

per this comment you may need to retoggle the intent in the portal.

SammyWhamy commented 2 years ago

per this comment you may need to retoggle the intent in the portal.

Did multiple times for all 4 applications! (Also confirmed the bot PATCH requests from the portal were sending correctly)

night commented 2 years ago

Thanks for the information. This appears to be a race condition issue. We will work on a fix and reply back when it is resolved.

night commented 2 years ago

This issue should now be resolved. If you're still seeing problems, head over to the application page in the developer portal to make sure the setting is turned on for you.

SammyWhamy commented 2 years ago

Well, tested it out, now none of the bots can get any messages anymore except their own. Message content is turned on and has been toggled a few times as well in the past 10 minutes.

My curl requests curl -H "Authorization: Bot **" https://discord.com/api/v10/channels/964658908268486677/messages/964658910021705758 only return content when the message is sent by the bot itself.

onerandomusername commented 2 years ago

Not surprised you're still having issues, this seems to be the second or third time this bug has been fixed.

SammyWhamy commented 2 years ago

Can this issue be reopened or should I open a new issue?

SammyWhamy commented 2 years ago

After toggling roughly 5 more times and making the toggling the "Public bot" switch off, it seems to work fine now. Regardless, it's still an issue if we need to toggle random switches many times until the intent works properly

bleonard252 commented 2 years ago

Maybe make sure you're requesting the intent?

advaith1 commented 2 years ago

Gateway identify does not affect the http API.