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

pincer.middleware.guild_member_add   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

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

2 Functions

Rating   Name   Duplication   Size   Complexity  
A guild_member_add() 0 12 1
A export() 0 2 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 new user joins a guild. The inner payload is a guild member object
6
with an extra ``guild_id`` key:
7
"""
8
9
from ..core.dispatch import GatewayDispatch
10
from ..utils import Coro
11
from ..objects.events.guild import GuildMemberAddEvent
12
13
14
async def guild_member_add(self, payload: GatewayDispatch):
0 ignored issues
show
Unused Code introduced by
The argument self seems to be unused.
Loading history...
15
    """
16
    Middleware for ``guild_member_add`` event.
17
18
    :param self:
19
        The current client/bot.
20
21
    :param payload:
22
        The data received from the event.
23
    """
24
25
    return "on_guild_member_add", [GuildMemberAddEvent.from_dict(payload.data)]
26
27
28
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
29
    return guild_member_add
30