Total Complexity | 2 |
Total Lines | 32 |
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(self, |
||
12 | payload: GatewayDispatch): |
||
13 | """ |
||
14 | Middleware for ``on_message_reaction_remove_all``, |
||
15 | creates a object for the message reactions that are removed |
||
16 | |||
17 | :param self: |
||
18 | The current client. |
||
19 | |||
20 | :param payload: |
||
21 | The data received from the message reaction remove all event. |
||
22 | """ |
||
23 | return "on_message_reaction_remove_all", [ |
||
24 | MessageReactionRemoveAllEvent.from_dict( |
||
25 | construct_client_dict(self, payload.data) |
||
26 | ) |
||
27 | ] |
||
28 | |||
29 | |||
30 | def export(): |
||
|
|||
31 | return message_reaction_remove_all_middleware |
||
32 |