twilight-rs / twilight

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

fix(model): bump `SessionStartLimit` field sizes #2286

Closed vilgotf closed 11 months ago

vilgotf commented 11 months ago

The largest bot is in ~21M guilds, meaning that its session start limit := max(2000, (guild_count / 1000) * 3) is just under u16::MAX (65535), so to safeguard against overflows we should bump the field sizes a step (u16 -> u32).

I also went ahead and bumped the max_concurrency field to u16, size it's plausible that this could exceed 255 by the largest bots.