Passed
Push — main ( d518db...6f129f )
by Yohann
01:23
created

chat_commands_class_based.Bot.say()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
from pincer import Client, command
2
from pincer.objects import Message, InteractionFlags
3
4
5
class Bot(Client):
6
    @Client.event
7
    async def on_ready(self):
8
        print(f"Started client on {self.bot}\n"
9
              "Registered commands: " + ", ".join(self.chat_commands))
10
11
    @command(description="Say something as the bot!")
12
    async def say(self, message: str):
13
        return message
14
15
    @command(description="Add two numbers!")
16
    async def add(self, first: int, second: int):
17
        return f"The addition of `{first}` and `{second}` is `{first + second}`"
18
19
    @command(guild=1324567890)
20
    async def private_say(self, message: str):
21
        return Message(message, flags=InteractionFlags.EPHEMERAL)
22
23
    @command(description="How to make embed!")
24
    async def pincer_embed(self):
25
        return Embed(
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable Embed does not seem to be defined.
Loading history...
26
            title="Pincer - 0.6.4",
27
            description=(
28
                "🚀 An asynchronous python API wrapper meant to replace"
29
                " discord.py\n> Snappy discord api wrapper written "
30
                "with aiohttp & websockets"
31
            )
32
        ).add_field(
33
            name="**Github Repository**",
34
            value="> https://github.com/Pincer-org/Pincer"
35
        ).set_thumbnail(
36
            url="https://pincer.dev/img/icon.png"
37
        ).set_image(
38
            url=(
39
                "https://repository-images.githubusercontent.com"
40
                "/400871418/045ebf39-7c6e-4c3a-b744-0c3122374203"
41
            )
42
        )
43
44
45
if __name__ == "__main__":
46
    Bot("XXXYOURBOTTOKENHEREXXX").run()
47