| Conditions | 1 |
| Total Lines | 26 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Copyright Pincer 2021-Present |
||
| 18 | async def channel_pins_update_middleware( |
||
| 19 | self: Client, gateway: Gateway, payload: GatewayDispatch |
||
| 20 | ): |
||
| 21 | """|coro| |
||
| 22 | |||
| 23 | Middleware for the ``on_channel_pins_update`` event. |
||
| 24 | |||
| 25 | Parameters |
||
| 26 | ---------- |
||
| 27 | payload : :class:`pincer.core.gateway.GatewayDispatch` |
||
| 28 | The data received from the channel pins update event. |
||
| 29 | gateway : :class:`~pincer.core.gateway.Gateway` |
||
| 30 | The gateway for the current shard. |
||
| 31 | |||
| 32 | Returns |
||
| 33 | ------- |
||
| 34 | Tuple[:class:`str`, :class:`~pincer.objects.guild.channel.Channel`] |
||
| 35 | ``on_channel_pins_update`` and a ``Channel`` |
||
| 36 | """ |
||
| 37 | |||
| 38 | event = ChannelPinsUpdateEvent.from_dict(payload.data) |
||
| 39 | self.channels[ |
||
| 40 | event.channel_id |
||
| 41 | ].last_pin_timestamp = event.last_pin_timestamp |
||
| 42 | |||
| 43 | return ("on_channel_pins_update", event) |
||
| 44 | |||
| 48 |