twilight-rs / twilight

Powerful, flexible, and scalable ecosystem of Rust libraries for the Discord API.
https://discord.gg/twilight-rs
ISC License
652 stars 130 forks source link

fix(model): Deserialize unavailable guilds in GUILD_CREATE. #2330

Closed Erk- closed 3 months ago

Erk- commented 4 months ago

This changes GuildCreate from being a tuple struct to being a enum that can either be available or unavailable, and containing either a full Guild or a UnavailableGuild.

Erk- commented 3 months ago

@Gelbpunkt Added a test now, which also made a small bug show up.