Passed
Push — main ( df1784...7b03e1 )
by
unknown
01:45
created

chat_commands_function_based   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 15
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A say() 0 3 1
A add() 0 3 1
A on_ready() 0 4 1
1
from pincer import command
2
from pincer.client import Client
3
4
5
@Client.event
6
async def on_ready(self):
7
    print(f"Started client on {self.bot}\n"
8
          "Registered commands: " + ", ".join(self.chat_commands))
9
10
11
@command(description="Say something as the bot!")
12
async def say(message: str):
13
    return message
14
15
16
@command(description="Add two numbers!")
17
async def add(first: int, second: int):
18
    return f"The addition of `{first}` and `{second}` is `{first + second}`"
19
20
21
if __name__ == "__main__":
22
    Client("XXXYOURBOTTOKENHEREXXX").run()
23