Total Complexity | 2 |
Total Lines | 29 |
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 | """sent when a user joins a subscribed voice channel""" |
||
5 | |||
6 | from ..core.dispatch import GatewayDispatch |
||
7 | from ..objects.user import VoiceState |
||
8 | from ..utils.conversion import construct_client_dict |
||
9 | |||
10 | |||
11 | async def voice_state_create_middleware(self, payload: GatewayDispatch): |
||
12 | """ |
||
13 | Middleware for ``on_voice_state_create`` event. |
||
14 | |||
15 | :param self: |
||
16 | The current client. |
||
17 | |||
18 | :param payload: |
||
19 | The data received from the voicestate delete event. |
||
20 | |||
21 | """ |
||
22 | return "on_voice_state_create", [ |
||
23 | VoiceState.from_dict(construct_client_dict(self, payload.data)) |
||
24 | ] |
||
25 | |||
26 | |||
27 | def export(): |
||
|
|||
28 | return voice_state_create_middleware |
||
29 |