disnake
disnake copied to clipboard
events: add on_raw_member_* events for when cache does not exist
Summary
on_member_remove fails when member_cache_flags is set to None
Reproduction Steps
- Set intents to include
members=True - Set member_cache_flags to be none
Minimal Reproducible Code
bot = commands.AutoShardedBot(
intents=disnake.Intents(guilds=True, messages=True, members=True),
member_cache_flags=disnake.MemberCacheFlags.none()
)
@bot.event
async def on_socket_event_type(event):# Returns GUILD_MEMBER_REMOVE
print(event)
@bot.event
async def on_member_remove(member):# Doesn't run
print(member)
Expected Results
on_member_remove runs
Actual Results
on_member_remove doesn't run even though it is received from the WebSocket.
Intents
guilds, messages, members
System Information
- Python v3.8.6-final
- disnake v2.4.0-final
- disnake pkg_resources: v2.4.0
- aiohttp v3.8.0
- system info: Darwin 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
No response
on_member_delete can't run because the member is not cached, but we should have an on_raw_member_delete event for when the member is not cached. Same goes for other member events that rely on the cache.
I'm planning to implement this!
Assigned you.