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

pincer.middleware.guild_members_chunk   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

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

2 Functions

Rating   Name   Duplication   Size   Complexity  
A export() 0 2 1
A guild_member_chunk() 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 in response to Guild Request Members. You can use the ``chunk_index``
6
and ``chunk_count`` to calculate how many chunks are left for your request.
7
"""
8
9
from ..core.dispatch import GatewayDispatch
10
from ..utils import Coro
11
from ..objects.events.guild import GuildMembersChunkEvent
12
13
14
async def guild_member_chunk(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_chunk`` 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 (
26
        "on_guild_member_chunk",
27
        [GuildMembersChunkEvent.from_dict(payload.data)]
28
    )
29
30
31
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
32
    return guild_member_chunk
33