Exemple #1
0
 def deserialize_voice_state_update_event(
     self, shard: gateway_shard.GatewayShard,
     payload: data_binding.JSONObject
 ) -> voice_events.VoiceStateUpdateEvent:
     state = self._app.entity_factory.deserialize_voice_state(payload)
     return voice_events.VoiceStateUpdateEvent(app=self._app,
                                               shard=shard,
                                               state=state)
Exemple #2
0
 def deserialize_voice_state_update_event(
     self,
     shard: gateway_shard.GatewayShard,
     payload: data_binding.JSONObject,
     *,
     old_state: typing.Optional[voices_models.VoiceState],
 ) -> voice_events.VoiceStateUpdateEvent:
     state = self._app.entity_factory.deserialize_voice_state(payload)
     return voice_events.VoiceStateUpdateEvent(app=self._app, shard=shard, state=state, old_state=old_state)
 def event(self):
     return voice_events.VoiceStateUpdateEvent(
         app=None,
         shard=object(),
         state=mock.Mock(voices.VoiceState),
         old_state=mock.Mock(voices.VoiceState))