| Total Complexity | 2 |
| Total Lines | 36 |
| 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.events.webhook import WebhooksUpdateEvent |
||
| 11 | from ..utils.conversion import construct_client_dict |
||
| 12 | |||
| 13 | |||
| 14 | async def webhooks_update_middleware(self, payload: GatewayDispatch): |
||
| 15 | """|coro| |
||
| 16 | |||
| 17 | Middleware for ``on_webhooks_update`` event. |
||
| 18 | |||
| 19 | Parameters |
||
| 20 | ---------- |
||
| 21 | payload : :class:`GatewayDispatch` |
||
| 22 | The data received from the webhooks update event. |
||
| 23 | |||
| 24 | Returns |
||
| 25 | ------- |
||
| 26 | Tuple[:class:`str`, List[:class:`~pincer.objects.events.webhook.WebhooksUpdateEvent`]] |
||
| 27 | ``on_webhooks_update`` and a ``WebhooksUpdateEvent`` |
||
| 28 | """ |
||
| 29 | return "on_webhooks_update", [ |
||
| 30 | WebhooksUpdateEvent.from_dict(construct_client_dict(self, payload.data)) |
||
| 31 | ] |
||
| 32 | |||
| 33 | |||
| 34 | def export(): |
||
|
|
|||
| 35 | return webhooks_update_middleware |
||
| 36 |