Skip to content

fix(guild): don't cache emojis/stickers/scheduled events if intent is disabled - #1083

Open
shiftinv wants to merge 5 commits into
masterfrom
fix/emoji-intent-cache
Open

fix(guild): don't cache emojis/stickers/scheduled events if intent is disabled#1083
shiftinv wants to merge 5 commits into
masterfrom
fix/emoji-intent-cache

Conversation

@shiftinv

Copy link
Copy Markdown
Member

Summary

Discord sends some fields in GUILD_CREATEs that are otherwise gated by intents, previously resulting in the library caching (and never updating) emojis, stickers, and scheduled_events even with the intent disabled.

This PR fixes the caching behavior to only cache them if the corresponding intent is enabled. It shouldn't affect non-gw guilds like those from fetch_guild etc., which continue to populate the emoji/sticker attributes.

No documentation changes since it didn't seem necessary, but can be added if there's demand for it.

This was brought up here: https://canary.discord.com/channels/808030843078836254/942319505915412500/1130943549937029170

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm lint
    • I have type-checked the code by running pdm pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@shiftinv shiftinv added s: needs review Issue/PR is awaiting reviews t: bugfix labels Jul 19, 2023
@shiftinv shiftinv added the 3.0 label Jan 20, 2024
@onerandomusername

Copy link
Copy Markdown
Member

@shiftinv could you please resolve conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0 s: needs review Issue/PR is awaiting reviews t: bugfix

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants