Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # Copyright Pincer 2021-Present |
||
2 | # Full MIT License can be found in `LICENSE` at the project root. |
||
3 | |||
4 | """ |
||
5 | sent when a user's voice state changes in a subscribed voice channel |
||
6 | (mute, volume, etc.) |
||
7 | """ |
||
8 | |||
9 | from ..core.dispatch import GatewayDispatch |
||
10 | from ..objects.user import VoiceState |
||
11 | |||
12 | |||
13 | async def voice_state_update_middleware(self, payload: GatewayDispatch): |
||
|
|||
14 | return "on_voice_state_update", [ |
||
15 | VoiceState.from_dict( |
||
16 | {"_client": self, "_http": self.http, **payload.data} |
||
17 | ) |
||
18 | ] |
||
19 | |||
20 | def export(): |
||
21 | return voice_state_update_middleware |
||
22 |