Passed
Pull Request — main (#163)
by
unknown
01:39
created

pincer.middleware.channel_pins_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
"""sent when a message in pinned/unpinned"""
5
6
from ..core.dispatch import GatewayDispatch
7
from ..objects.events.channel import ChannelPinsUpdateEvent
8
from ..utils import Timestamp
0 ignored issues
show
Unused Code introduced by
Unused Timestamp imported from utils
Loading history...
9
10
11
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...
12
    """
13
    Middleware for ``on_channel_pins_update``,
14
        creates a object for the message pinned/unpinned
15
16
    :param self:
17
        The current client.
18
19
    :param payload:
20
        The data received from the channel pins update event.
21
    """
22
    return "on_channel_pins_update", [
23
        ChannelPinsUpdateEvent.from_dict(payload.data)
24
    ]
25
26
27
def export():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
28
    return channel_pins_update_middleware
29