Total Complexity | 2 |
Total Lines | 30 |
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 new user joins a guild. The inner payload is a guild member object |
||
6 | with an extra ``guild_id`` key: |
||
7 | """ |
||
8 | |||
9 | from ..core.dispatch import GatewayDispatch |
||
10 | from ..utils import Coro |
||
11 | from ..objects.events.guild import GuildMemberAddEvent |
||
12 | |||
13 | |||
14 | async def guild_member_add(self, payload: GatewayDispatch): |
||
|
|||
15 | """ |
||
16 | Middleware for ``guild_member_add`` 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 "on_guild_member_add", [GuildMemberAddEvent.from_dict(payload.data)] |
||
26 | |||
27 | |||
28 | def export() -> Coro: |
||
29 | return guild_member_add |
||
30 |