-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialization of discord template into DiscordTemplate struct fails #1394
Comments
Since this is a bug with the Discord API (snowflakes must always be returned as strings in the HTTP API), I have created an issue on their side: discord/discord-api-docs#6609 In the meantime, discordgo may want to consider using |
This has always been the case for templates, so I honestly don't think it's a bug. The snowflakes in guild templates are just serial numbers starting at 0. Changing it now would be a breaking change in the Discord API which won't happen until the next major version. |
I agree it would be a breaking change, but it's still a bug, since the field is
Returning an int breaks the invariant that snowflake is always a string. I don't know what the policy on breaking changes is in this project, but I'll have a look into changing snowflake fields here to |
I don't think we need to update all snowflake fields to support number values. Because these fields aren't actually snowflakes (see the attachment) and this behavior occurs only in the serialized guild object. |
Deserializing a discord template into the DiscordTemplate struct doesn't work as it's using the standard
Guild
struct for theserialized_source_guild
field. Seediscordgo/structs.go
Line 1103 in a90485d
This fails because all IDs in the discord template data are integers instead of strings.
The text was updated successfully, but these errors were encountered: