Total Complexity | 1 |
Total Lines | 22 |
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 channel is created/joined on the client""" |
||
5 | from pincer.core.dispatch import GatewayDispatch |
||
6 | from pincer.objects import Channel |
||
7 | |||
8 | |||
9 | def channel_create_middleware(self, payload: GatewayDispatch): |
||
10 | """ |
||
11 | Middleware for ``on_error`` event. |
||
12 | |||
13 | :param client: |
||
14 | |||
15 | :param payload: |
||
16 | The data received from the ready event. |
||
17 | """ |
||
18 | |||
19 | return "on_channel_creation", [ |
||
|
|||
20 | Channel.from_dict( |
||
21 | {"_client": self, "_http": self.http, **payload.data} |
||
22 | ) |
||
24 |