Passed
Pull Request — main (#174)
by
unknown
01:43
created

pincer.middleware.channel_pins_update   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A channel_pins_update_middleware() 0 21 1
A export() 0 2 1
1
# Copyright Pincer 2021-Present
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
"""sent when a message in pinned/unpinned"""
5
6
from ..core.dispatch import GatewayDispatch
7
from ..objects.events.channel import ChannelPinsUpdateEvent
8
9
10
async def channel_pins_update_middleware(self, payload: GatewayDispatch):
0 ignored issues
show
Unused Code introduced by
The argument self seems to be unused.
Loading history...
11
    """|coro|
12
13
    Middleware for ``on_channel_pins_update``,
14
15
    Parameters
16
    ----------
17
    self : :class:`Client`
18
        The current client/bot.
19
20
    payload : :class:`pincer.core.dispatch.GatewayDispatch`
21
        The data received from the channel pins update event.
22
23
    Returns
24
    -------
25
    Tuple[:class:`str`, List[:class:`~pincer.objects.guild.channel.Channel`]]
26
        ``on_channel_pins_update`` and a ``Channel``
27
    """
28
29
    return "on_channel_pins_update", [
30
        ChannelPinsUpdateEvent.from_dict(payload.data)
31
    ]
32
33
34
def export():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
35
    return channel_pins_update_middleware
36