Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix guild deserialisation regression (#640)
A regression in 'model::guild::Guild' deserialization was introduced by commit 4541935[1]. The bug introduced was that deserialisation of 'Guild::premium_subscription_count'[2] would fail. The 'premium_subscription_count' field isn't always present in the JSON provided as noted by the REST API documentation[3], so a default value needs to be set for it, in this case 0. Additionally, set a default value for 'Guild::premium_tier'[4] in case this is ever nulled in the API too, defaulting to 'PremiumTier::Tier0'. [1]: 4541935 [2]: 4541935#diff-e1c86b244465a2bb338d53758aa2c7efR154 [3]: discord/discord-api-docs@3d8cca0#diff-c4e1390fca89ecc96b01a093f988fa1cR48 [4]: 4541935#diff-e1c86b244465a2bb338d53758aa2c7efR156 Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
- Loading branch information