export()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 0
1
# Copyright Pincer 2021-Present
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
"""sent when a user explicitly removes all reactions from a message."""
5
6
from __future__ import annotations
7
8
from typing import TYPE_CHECKING
9
10
from ..objects.events.message import MessageReactionRemoveAllEvent
11
12
if TYPE_CHECKING:
13
    from ..client import Client
14
    from ..core.gateway import Gateway
15
    from ..core.gateway import GatewayDispatch
16
17
18
async def message_reaction_remove_all_middleware(
19
    self: Client, gateway: Gateway, payload: GatewayDispatch
0 ignored issues
show
Unused Code introduced by
The argument gateway seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument self seems to be unused.
Loading history...
20
):
21
    """|coro|
22
23
    Middleware for the ``on_message_reaction_remove_all`` event.
24
25
    Parameters
26
    ----------
27
    payload : :class:`~pincer.core.gateway.GatewayDispatch`
28
        The data received from the message reaction remove all event.
29
    gateway : :class:`~pincer.core.gateway.Gateway`
30
        The gateway for the current shard.
31
32
    Returns
33
    -------
34
    Tuple[:class:`str`, :class:`~pincer.objects.events.message.MessageReactionRemoveAllEvent`]
35
        ``on_message_reaction_remove_all`` and an ``MessageReactionRemoveAllEvent``
36
    """  # noqa: E501
37
38
    return (
39
        "on_message_reaction_remove_all",
40
        MessageReactionRemoveAllEvent.from_dict(payload.data),
41
    )
42
43
44
def export():
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
45
    return message_reaction_remove_all_middleware
46