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 | """ |
||
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 ..objects.events.guild import GuildMemberRemoveEvent |
||
11 | |||
12 | |||
13 | async def guild_member_remove(self, payload: GatewayDispatch): |
||
|
|||
14 | """ |
||
15 | Middleware for ``guild_member_remove`` event. |
||
16 | |||
17 | :param self: |
||
18 | The current client/bot. |
||
19 | |||
20 | :param payload: |
||
21 | The data received from the event. |
||
22 | """ |
||
23 | |||
24 | return ( |
||
25 | "on_guild_member_remove", |
||
26 | [GuildMemberRemoveEvent.from_dict(payload.data)] |
||
27 | ) |
||
28 | |||
29 | |||
30 | def export() -> Coro: |
||
31 | return guild_member_remove |
||
32 |