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

context.Bot.say()   A

Complexity

Conditions 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
from pincer import Client, command
2
from pincer.objects import Embed
3
4
5
class Bot(Client):
6
7
    @command(description="Say something as the bot!")
8
    async def say(self, ctx, content: str) -> Embed:
9
        # Using the ctx to get the command author
10
        return Embed(
11
            description=f"{ctx.author.user.mention} said {content}"
12
        )
13
14
    @Client.event
15
    async def on_ready(self):
16
        # Our client has successfully started, lets let ourself know that!
17
        print("Logged in as", self.bot)
18
19
20
if __name__ == "__main__":
21
    Bot("XXXYOURBOTTOKENHEREXXX").run()
22