pubsub: add passthrough logic

This commit is contained in:
Luna 2021-07-14 15:04:33 -03:00
parent bc1c0f3b20
commit a51840487f
2 changed files with 10 additions and 8 deletions

View File

@ -69,7 +69,8 @@ class ChannelDispatcher(
await self.unsub(channel_id, session_id) await self.unsub(channel_id, session_id)
continue continue
wanted_intent = EVENTS_TO_INTENTS[event_type] wanted_intent = EVENTS_TO_INTENTS.get(event_type)
if wanted_intent is not None:
state_has_intent = (state.intents & wanted_intent) == wanted_intent state_has_intent = (state.intents & wanted_intent) == wanted_intent
if not state_has_intent: if not state_has_intent:
continue continue

View File

@ -69,7 +69,8 @@ class GuildDispatcher(
await self.unsub(guild_id, session_id) await self.unsub(guild_id, session_id)
continue continue
wanted_intent = EVENTS_TO_INTENTS[event_type] wanted_intent = EVENTS_TO_INTENTS.get(event_type)
if wanted_intent is not None:
state_has_intent = (state.intents & wanted_intent) == wanted_intent state_has_intent = (state.intents & wanted_intent) == wanted_intent
if not state_has_intent: if not state_has_intent:
continue continue