Skip to content
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

fix: always emit guildUnavailable if a guild became unavailable #3975

merged 1 commit into from Mar 21, 2020


Copy link

SpaceEEC commented Mar 20, 2020

Please describe the changes this PR makes and why it should be merged:

Currently when an unavailable guild "becomes" unavailable it will be treated as a regular guildDelete instead.

  • Removal from cache
  • Emitting guildDelete
  • etc.

This is because we only allow "available" guilds to become unavailable:

if (guild.available && data.unavailable) {

While this assumption seems sound, Discord seems to still emit such packets during outages (maybe for guilds that hit a presence limit too).

This PR will always treat guilds that became unavailable as such instead of treating them as "deleted" guilds.

This might also fix unexpected guildCreate events during / after outages as those guilds are still kept cached (as intended).


  • Code changes have been tested against the Discord API, or there are no code changes
    I do not happen to have an outage to test this at hand.
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.
iCrawl approved these changes Mar 21, 2020
@amishshah amishshah merged commit 2157401 into discordjs:master Mar 21, 2020
3 checks passed
3 checks passed
@SpaceEEC SpaceEEC deleted the SpaceEEC:fix/guild_delete_unavailable branch Mar 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.