async def test_on_connected(self, event_manager, app, shard, payload): expected_dispatch = shard_events.ShardConnectedEvent(app=app, shard=shard) await event_manager.on_connected(shard, payload) event_manager.dispatch.assert_awaited_once_with(expected_dispatch)
async def on_connected(self, shard: gateway_shard.GatewayShard, _: data_binding.JSONObject) -> None: """Handle connection events. This is a synthetic event produced by the gateway implementation in Hikari. """ # TODO: this should be in entity factory await self.dispatch(shard_events.ShardConnectedEvent(app=self._app, shard=shard))
def deserialize_connected_event( self, shard: gateway_shard.GatewayShard ) -> shard_events.ShardConnectedEvent: return shard_events.ShardConnectedEvent(app=self._app, shard=shard)