| Conditions | 4 |
| Total Lines | 24 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Copyright Pincer 2021-Present |
||
| 17 | async def ready_middleware(self, payload: GatewayDispatch): |
||
| 18 | """|coro| |
||
| 19 | |||
| 20 | Middleware for ``on_ready`` event. |
||
| 21 | |||
| 22 | Parameters |
||
| 23 | ---------- |
||
| 24 | self : :class:`Client` |
||
| 25 | The current client/bot |
||
| 26 | |||
| 27 | payload : :class:`GatewayDispatch` |
||
| 28 | The data recieved from the stage instance create event |
||
| 29 | |||
| 30 | Returns |
||
| 31 | ------- |
||
| 32 | Tuple[:class:`str`] |
||
| 33 | ``on_ready`` |
||
| 34 | """ |
||
| 35 | user = payload.data.get("user") |
||
| 36 | guilds = payload.data.get("guilds") |
||
| 37 | |||
| 38 | if not user or guilds is None: |
||
| 39 | raise InvalidPayload( |
||
| 40 | "A `user` and `guilds` key/value pair is expected on the " |
||
| 41 | "`ready` payload event." |
||
| 53 |