Passed
Pull Request — main (#162)
by
unknown
01:33
created

pincer.middleware.guild_member_remove.export()   A

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
"""
5
Sent when a user is removed from a guild (leave/kick/ban).
6
"""
7
8
from ..core.dispatch import GatewayDispatch
9
from ..utils import Coro
10
from ..utils.conversion import construct_client_dict
11
from ..objects.events.guild import GuildMemberRemoveEvent
12
13
14
async def guild_member_remove_middleware(self, payload: GatewayDispatch):
15
    """|coro|
16
17
    Middleware for ``on_guild_member_remove`` event.
18
19
    Parameters
20
    ----------
21
    self : :class:`Client`
22
        The current client/bot.
23
24
    payload : :class:`GatewayDispatch`
25
        The data received from the guild member remove event.
26
    """
27
28
    return (
29
        "on_guild_member_remove",
30
        [GuildMemberRemoveEvent.from_dict(
31
            construct_client_dict(self, payload.data)
32
        )]
33
    )
34
35
36
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
37
    return guild_member_remove_middleware
38