Total Complexity | 2 |
Total Lines | 33 |
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 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): |
||
|
|||
11 | """|coro| |
||
12 | |||
13 | Middleware for ``on_channel_pins_update``, |
||
14 | |||
15 | Parameters |
||
16 | ---------- |
||
17 | payload : :class:`pincer.core.dispatch.GatewayDispatch` |
||
18 | The data received from the channel pins update event. |
||
19 | |||
20 | Returns |
||
21 | ------- |
||
22 | Tuple[:class:`str`, List[:class:`~pincer.objects.guild.channel.Channel`]] |
||
23 | ``on_channel_pins_update`` and a ``Channel`` |
||
24 | """ |
||
25 | |||
26 | return "on_channel_pins_update", [ |
||
27 | ChannelPinsUpdateEvent.from_dict(payload.data) |
||
28 | ] |
||
29 | |||
30 | |||
31 | def export(): |
||
32 | return channel_pins_update_middleware |
||
33 |