pincer.middleware.guild_ban_remove.export()   A
last analyzed

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
"""sent when a guild ban is removed."""
5
6
from __future__ import annotations
7
8
from typing import TYPE_CHECKING
9
10
from ..objects.events.guild import GuildBanRemoveEvent
11
from ..utils import Coro
12
13
if TYPE_CHECKING:
14
    from ..client import Client
15
    from ..core.gateway import Gateway
16
    from ..core.gateway import GatewayDispatch
17
18
19
async def guild_ban_remove_middleware(
20
    self: Client, gateway: Gateway, payload: GatewayDispatch
0 ignored issues
show
Unused Code introduced by
The argument gateway seems to be unused.
Loading history...
Coding Style introduced by
Wrong hanging indentation before block (add 4 spaces).
Loading history...
Unused Code introduced by
The argument self seems to be unused.
Loading history...
21
):
22
    """|coro|
23
24
    Middleware for the ``on_guild_ban_remove`` event.
25
26
    Parameters
27
    ----------
28
    payload : :class:`~pincer.core.gateway.GatewayDispatch`
29
        The data received from the guild ban remove event.
30
    gateway : :class:`~pincer.core.gateway.Gateway`
31
        The gateway for the current shard.
32
33
    Returns
34
    -------
35
    Tuple[:class:`str`, :class:`~pincer.objects.events.guild.GuildBanRemoveEvent`]
36
        ``on_guild_ban_remove_update`` and a ``GuildBanRemoveEvent``
37
    """  # noqa: E501
38
39
    return ("on_guild_ban_remove", GuildBanRemoveEvent.from_dict(payload.data))
40
41
42
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
43
    return guild_ban_remove_middleware
44