Passed
Push — main ( 834059...84c92a )
by Yohann
01:29
created

pincer.middleware.channel_create   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A channel_create_middleware() 0 13 1
1
# Copyright Pincer 2021-Present
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
"""sent when a channel is created/joined on the client"""
5
from pincer.core.dispatch import GatewayDispatch
6
from pincer.objects import Channel
7
8
9
def channel_create_middleware(self, payload: GatewayDispatch):
10
    """
11
    Middleware for ``on_error`` event.
12
13
    :param client:
14
15
    :param payload:
16
        The data received from the ready event.
17
    """
18
19
    return "on_channel_creation",  [
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
Loading history...
20
        Channel.from_dict(
21
            {"_client": self, "_http": self.http, **payload.data}
22
        )
23
    ]
24