-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some gateway deserialization errors (#577)
## Description: - Discord is messing with their api again, read states are a mystery - Refactored the gateway to fully use the `Opcode` enum instead of constants (4ed68ce) - Added Last Messages request and response (4ed68ce) - Fixed a deserialization error related to `presences` in `GuildMembersChunk` being an array, not a single value (4baecf9) - Fixed a deserialization error with deserializing `activities` in `PresenceUpdate` as an empty array when they are sent as `null` (1b20102) - Add type `OneOrMoreSnowflakes`, allow `GatewayRequestGuildMembers` to request multiple guild and user ids (644d3be, 85e922b) - Updated `LazyRequest` (op 14) to use the `Snowflake` type for ids instead of just `String` (61ac7d1) - Fixed a deserialization error on discord.com related to experiments (they are not implemented yet, see #578) (7feb571) - Fixed a deserialization error on discord.com related to `last_viewed` in `ReadState` being a version / counter, not a `DateTime` (fb94afa) ## Commits: * fix: temporarily fix READY on Spacebar Spacebar servers have mention_count in ReadStateEntry as nullable, as well as not having the flags field This should probably be investigated further Reported by greysilly7 on the polyphony discord * fix: on DDC the user field in Relationship is not send in READY anymore * fix: for some reason presences wasn't an array?? * fix: deserialize activities: null as empty array * feat: add OneOrMoreSnowflakes type Adds a public type which allows serializing one snowflake or an array of snowflakes. Useful for e.g. request guild members, where we can request either for one user or for multiple * feat: update RequestGuildMembers, allow multiple snowflakes Updates the RequsetGuildMembers gateway event, allows to query multiple user_ids and guild_ids using OneOrMoreSnowflakes type, update its documentation * fix?: add Default to OneOrMoreSnowflakes, GatewayRequestGuildMembers * feat: add gateway last messages, refactor gateway to use Opcode enum * fix: the string in lazy request is a snowflake * fix: deserialization error related to experiments on Discord.com See also #578 on why we aren't currently juts implementing them as types * fix?: last_viewed is a counter, not a datetime thanks to MaddyUnderStars; this explanation seems to make sense considering we only need to know if we are ahead / behind the version, not when exactly it was accessed
- Loading branch information
1 parent
5adc0bc
commit 7369016
Showing
15 changed files
with
311 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.