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

pincer.middleware.guild_members_chunk.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 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 ..utils.conversion import construct_client_dict
12
from ..objects.events.guild import GuildMembersChunkEvent
13
14
15
async def guild_member_chunk_middleware(self, payload: GatewayDispatch):
16
    """|coro|
17
    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
18
    Middleware for ``on_guild_member_chunk`` event.
19
20
    Parameters
21
    ----------
22
    self : :class:`Client`
23
        The current client/bot.
24
25
    payload : :class:`GatewayDispatch`
26
        The data received from the guild member chunk event.
27
    """
28
29
    return (
30
        "on_guild_member_chunk",
31
        [GuildMembersChunkEvent.from_dict(
32
            construct_client_dict(self, payload.data)
33
        )]
34
    )
35
36
37
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
38
    return guild_member_chunk_middleware
39