disnake icon indicating copy to clipboard operation
disnake copied to clipboard

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

Open shiftinv opened this issue 2 years ago • 1 comments

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

  • [x] If code changes were made, then they have been tested
    • [ ] I have updated the documentation to reflect the changes
    • [x] I have formatted the code properly by running pdm lint
    • [x] I have type-checked the code by running pdm pyright
  • [x] 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 avatar Jul 19 '23 12:07 shiftinv

@shiftinv could you please resolve conflicts?

onerandomusername avatar Sep 19 '25 20:09 onerandomusername