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

pincer.middleware.guild_member_remove   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A export() 0 2 1
A guild_member_remove() 0 14 1
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 ..objects.events.guild import GuildMemberRemoveEvent
11
12
13
async def guild_member_remove(self, payload: GatewayDispatch):
0 ignored issues
show
Unused Code introduced by
The argument self seems to be unused.
Loading history...
14
    """
15
    Middleware for ``guild_member_remove`` event.
16
17
    :param self:
18
        The current client/bot.
19
20
    :param payload:
21
        The data received from the event.
22
    """
23
24
    return (
25
        "on_guild_member_remove",
26
        [GuildMemberRemoveEvent.from_dict(payload.data)]
27
    )
28
29
30
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
31
    return guild_member_remove
32