| Conditions | 1 |
| Total Lines | 20 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Copyright Pincer 2021-Present |
||
| 19 | async def message_create_middleware( |
||
| 20 | self: Client, gateway: Gateway, payload: GatewayDispatch |
||
| 21 | ) -> Tuple[str, UserMessage]: # noqa: E501 |
||
| 22 | """|coro| |
||
| 23 | |||
| 24 | Middleware for the ``on_message`` event. |
||
| 25 | |||
| 26 | Parameters |
||
| 27 | ---------- |
||
| 28 | payload : :class:`pincer.core.gateway.GatewayDispatch` |
||
| 29 | The data received from the message creation event. |
||
| 30 | gateway : :class:`~pincer.core.gateway.Gateway` |
||
| 31 | The gateway for the current shard. |
||
| 32 | |||
| 33 | Returns |
||
| 34 | ------- |
||
| 35 | Tuple[:class:`str`, :class:`~pincer.objects.message.user_message.UserMessage`] |
||
| 36 | ``on_message`` and a ``UserMessage`` |
||
| 37 | """ # noqa: E501 |
||
| 38 | return ("on_message", UserMessage.from_dict(payload.data)) |
||
| 39 | |||
| 43 |