Completed
Push — main ( 569940...9b1556 )
by
unknown
26s queued 12s
created

pincer.middleware.activity_join.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 when the user clicks a Rich Presence join invite in chat
6
to join a game.
7
"""
8
9
from ..objects.events.activity import ActivityJoinEvent
10
from ..utils.conversion import construct_client_dict
11
from ..core.dispatch import GatewayDispatch
12
from ..utils.types import Coro
13
14
15
async def activity_join_middleware(self, payload: GatewayDispatch):
16
    """|coro|
17
18
    Middleware for ``on_activity_join`` event.
19
20
    Parameters
21
    ----------
22
    payload : :class:`GatewayDispatch`
23
        The data received from the activity join event.
24
25
    Returns
26
    -------
27
    Tuple[:class:`str`, List[:class:`ActivityJoinEvent`]]
28
        ``on_activity_join`` and an ``ActivityJoinEvent``
29
    """
30
    return "on_activity_join", [
31
        ActivityJoinEvent.from_dict(construct_client_dict(self, payload.data))
32
    ]
33
34
35
def export() -> Coro:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
36
    return activity_join_middleware
37