Total Complexity | 2 |
Total Lines | 18 |
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 guild is created/joined on the client""" |
||
5 | |||
6 | from ..core.dispatch import GatewayDispatch |
||
7 | from ..objects.guild import Guild |
||
8 | |||
9 | async def guild_create_middleware(self, payload: GatewayDispatch): |
||
|
|||
10 | return "on_guild_create", [ |
||
11 | Guild.from_dict( |
||
12 | {"_client": self, "_http": self.http, **payload.data} |
||
13 | ) |
||
14 | ] |
||
15 | |||
16 | def export(): |
||
17 | return guild_create_middleware |
||
18 |