| Total Complexity | 2 |
| Total Lines | 42 |
| 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 user explicitly removes all reactions from a message.""" |
||
| 5 | |||
| 6 | from ..core.dispatch import GatewayDispatch |
||
| 7 | from ..objects.events.message import MessageReactionRemoveAllEvent |
||
| 8 | from ..utils.conversion import construct_client_dict |
||
| 9 | |||
| 10 | |||
| 11 | async def message_reaction_remove_all_middleware( |
||
| 12 | self, |
||
|
|
|||
| 13 | payload: GatewayDispatch): |
||
| 14 | """|coro| |
||
| 15 | |||
| 16 | Middleware for ``on_message_reaction_remove_all`` event. |
||
| 17 | |||
| 18 | Parameters |
||
| 19 | ---------- |
||
| 20 | self : :class:`Client` |
||
| 21 | The current client/bot. |
||
| 22 | |||
| 23 | payload : :class:`GatewayDispatch` |
||
| 24 | The data received from the message reaction remove all event. |
||
| 25 | |||
| 26 | |||
| 27 | Returns |
||
| 28 | ------- |
||
| 29 | Tuple[:class:`str`, List[:class:`~pincer.objects.events.message.MessageReactionRemoveAllEvent`]] |
||
| 30 | ``on_message_reaction_remove_all`` and an ``MessageReactionRemoveAllEvent`` |
||
| 31 | """ |
||
| 32 | |||
| 33 | return "on_message_reaction_remove_all", [ |
||
| 34 | MessageReactionRemoveAllEvent.from_dict( |
||
| 35 | construct_client_dict(self, payload.data) |
||
| 36 | ) |
||
| 37 | ] |
||
| 38 | |||
| 39 | |||
| 40 | def export(): |
||
| 41 | return message_reaction_remove_all_middleware |
||
| 42 |