discord-api-docs
discord-api-docs copied to clipboard
Activity gateway event may contain invalid snowflakes
Description
I've witnessed the GUILD_CREATE
event sending through an activity with an application_id
of 1
. Note that this is a numerical 1, not a string.
The docs show that the data type here should be a snowflake
, and the snowflake docs say that this should always be a string.
Out of 1142 activities found on my GUILD_CREATE
event, the following is the one and only activity with a non-string application_id.
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"type": 1,
"timestamps": {
"start": 1711557036583
},
"state": "Playing Single Player",
"session_id": "cedf635683339917672bc194bf59b35d",
"name": "Grand Theft Auto 6",
"id": "876e03ca62d9cfc2",
"flags": 1,
"details": "Grand Theft Auto VI",
"created_at": 1711557037898,
"assets": {
"small_image": "mp:external/ruoyEd5pgWX_V3GB4FWCzMZyRVJZFedojHrb07B-nJA/https/media.tenor.com/ByYRHA88z_8AAAAj/bottas-crash.gif",
"large_image": "mp:attachments/812394872392122390/1218155883431858207/gtavi.png?ex=6606a312&is=65f42e12&hm=8a29b83a446c91ea04500d265ee317709a0c3aff971e04807ee48e1b2b3b5da2&"
},
"application_id": 1
}
Steps to Reproduce
Sorry but I'm not sure on this one.
I assume it's related the the way the activity was created but I have no visibility of that.
This was happening for a specific guild 517776987419574272
.
I am using the standard wsapi in discordgo
(links further on under client and system information), listening for GUILD_CREATE
events.
Expected Behavior
String values to be sent across for any fields with a snowflake
data type.
Current Behavior
A numerical 1
being sent as a value for a snowflake
data type, in one out of many cases.
Screenshots/Videos
No response
Client and System Information
I am using https://github.com/bwmarrin/discordgo v0.27.1.
I have adjusted to use a fork (https://github.com/TomWright/discordgo) which gets around this issue with this change:
https://github.com/TomWright/discordgo/commit/2d4dd73f645e5a23de1630c6b9129799d4fdccbf
The client is runner under go version go1.22.1
Related to https://github.com/discord/discord-api-docs/issues/6609.
The type difference is explained here (#1078), but does conflict with the "always" language that you quoted.
Edit: This exception applies to user provided input, so maybe it's irrelevant.
This will never happen with IDs that come from Discord.
It's possible that discordgo is requesting this data, but as I understand it the data is coming from discord in response to a READY request.
"1" is not valid application_id tho, curious how you got it ><
@lsdimagine I wish I could give you more information on that. I'm developing a bot for a discord server that I don't own and this activity exists there