Skip to content

Commit

Permalink
remove _dispatches_for_cache + add in missing filtered decorator calls
Browse files Browse the repository at this point in the history
  • Loading branch information
FasterSpeeding committed Aug 4, 2021
1 parent 90761b0 commit 3c086ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions hikari/impl/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from hikari import intents as intents_
from hikari import presences as presences_
from hikari import snowflakes
from hikari.events import interaction_events
from hikari.events import channel_events
from hikari.events import guild_events
from hikari.events import member_events
Expand Down Expand Up @@ -644,24 +645,28 @@ async def on_webhooks_update(self, shard: gateway_shard.GatewayShard, payload: d
"""See https://discord.com/developers/docs/topics/gateway#webhooks-update for more info."""
await self.dispatch(self._event_factory.deserialize_webhook_update_event(shard, payload))

@event_manager_base.filtered(interaction_events.CommandCreateEvent)
async def on_application_command_create(
self, shard: gateway_shard.GatewayShard, payload: data_binding.JSONObject
) -> None:
"""See https://discord.com/developers/docs/topics/gateway#application-command-create for more info."""
await self.dispatch(self._event_factory.deserialize_command_create_event(shard, payload))

@event_manager_base.filtered(interaction_events.CommandUpdateEvent)
async def on_application_command_update(
self, shard: gateway_shard.GatewayShard, payload: data_binding.JSONObject
) -> None:
"""See https://discord.com/developers/docs/topics/gateway#application-command-update for more info."""
await self.dispatch(self._event_factory.deserialize_command_update_event(shard, payload))

@event_manager_base.filtered(interaction_events.CommandDeleteEvent)
async def on_application_command_delete(
self, shard: gateway_shard.GatewayShard, payload: data_binding.JSONObject
) -> None:
"""See https://discord.com/developers/docs/topics/gateway#application-command-delete for more info."""
await self.dispatch(self._event_factory.deserialize_command_delete_event(shard, payload))

@event_manager_base.filtered(interaction_events.InteractionCreateEvent)
async def on_interaction_create(self, shard: gateway_shard.GatewayShard, payload: data_binding.JSONObject) -> None:
"""See https://discord.com/developers/docs/topics/gateway#interaction-create for more info."""
await self.dispatch(self._event_factory.deserialize_interaction_create_event(shard, payload))
2 changes: 0 additions & 2 deletions hikari/impl/event_manager_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ class EventManagerBase(event_manager_.EventManager):

__slots__: typing.Sequence[str] = (
"_consumers",
"_dispatches_for_cache",
"_enabled_consumers_cache",
"_event_factory",
"_intents",
Expand All @@ -335,7 +334,6 @@ def __init__(
cache_components: config.CacheComponents = config.CacheComponents.NONE,
) -> None:
self._consumers: typing.Dict[str, _Consumer] = {}
self._dispatches_for_cache: typing.Dict[_Consumer, bool] = {}
self._enabled_consumers_cache: typing.Dict[_Consumer, bool] = {}
self._event_factory = event_factory
self._intents = intents
Expand Down

0 comments on commit 3c086ea

Please sign in to comment.