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

guild_member_add()   A

Complexity

Conditions 1

Size

Total Lines 12
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 12
rs 10
c 0
b 0
f 0
cc 1
nop 2
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