Completed
Push — main ( 569940...9b1556 )
by
unknown
26s queued 12s
created

pincer.middleware.webhooks_update.export()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 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():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
35
    return webhooks_update_middleware
36