Conditions | 1 |
Total Lines | 17 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # Copyright Pincer 2021-Present |
||
11 | async def channel_pins_update_middleware(self, payload: GatewayDispatch): |
||
|
|||
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({ |
||
24 | "last_pin_timestamp": Timestamp( |
||
25 | payload.data.pop("last_pin_timestamp") |
||
26 | ), |
||
27 | **payload.data |
||
28 | }) |
||
34 |