react   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 25
dl 0
loc 36
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A React.__init__() 0 2 1
A React.on_message() 0 4 2
1
from __future__ import annotations
2
3
from random import choice
4
from pincer import Client
5
from typing import TYPE_CHECKING
6
7
if TYPE_CHECKING:
8
    from pincer.objects import UserMessage
9
10
PINCER_EMOTES = (
11
    "pincer_blue:905204976601681921",
12
    "pincer_green:905204638746279949",
13
    "pincer_grey:905208040716898305",
14
    "pincer_orange:905204645989871736",
15
    "pincer_pink:905204650335162378",
16
    "pincer_purple:905207327710392330",
17
    "pincer:881987938303488031",
18
    "pincer_red:905206299795538032",
19
    "pincer_cyan:910625755241779261"
20
)
21
22
23
class React:
24
25
    def __init__(self, client: Client) -> None:
26
        self.client = client
27
28
    @Client.event
29
    async def on_message(self, message: UserMessage):
30
        if 'pincer' in message.content.lower():
31
            await message.react(choice(PINCER_EMOTES))
32
33
34
35
setup = React
36