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(Guild): guild.available is never set on new joins #6769

Merged
merged 2 commits into from Oct 12, 2021

Conversation

cycloptux
Copy link
Contributor

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

This fixes a bug that was introduced in #6694 where, if the data passed to the constructor of a Guild doesn't explicitly have the unavailable field, then the corresponding available field of the cached Guild will never be set, resulting in this.available returning undefined (false-y) despite the guild being available.

This scenario specifically happens when inviting a bot to a new guild since the unavailable field is missing, whereas the GUILD_CREATE event the client receives on startup has the field and is processed correctly.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@PuneetGopinath
Copy link

I guess this bug caused #6595

@almeidx
Copy link
Member

almeidx commented Oct 6, 2021

I guess this bug caused #6595

That issue was made long before the pull request that introduced this bug was

@iCrawl iCrawl added this to the Version 13.3 milestone Oct 6, 2021
src/structures/Guild.js Outdated Show resolved Hide resolved
@iCrawl iCrawl merged commit 29667c9 into discordjs:main Oct 12, 2021
@cycloptux cycloptux deleted the fix-guild-available-not-set branch October 12, 2021 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants