Total Complexity | 2 |
Total Lines | 35 |
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 | """ |
||
5 | Sent when a user is removed from a guild (leave/kick/ban). |
||
6 | """ |
||
7 | |||
8 | from ..core.dispatch import GatewayDispatch |
||
9 | from ..utils import Coro |
||
10 | from ..utils.conversion import construct_client_dict |
||
11 | from ..objects.events.guild import GuildMemberRemoveEvent |
||
12 | |||
13 | |||
14 | async def guild_member_remove_middleware(self, payload: GatewayDispatch): |
||
15 | """ |
||
16 | Middleware for ``on_guild_member_remove`` event. |
||
17 | |||
18 | :param self: |
||
19 | The current client/bot. |
||
20 | |||
21 | :param payload: |
||
22 | The data received from the event. |
||
23 | """ |
||
24 | |||
25 | return ( |
||
26 | "on_guild_member_remove", |
||
27 | [GuildMemberRemoveEvent.from_dict( |
||
28 | construct_client_dict(self, payload.data) |
||
29 | )] |
||
30 | ) |
||
31 | |||
32 | |||
33 | def export() -> Coro: |
||
|
|||
34 | return guild_member_remove_middleware |
||
35 |