Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from pincer import Client |
||
2 | from pincer.commands import command, CommandArg, Description |
||
3 | from pincer.objects import Embed, MessageContext |
||
4 | |||
5 | |||
6 | class Bot(Client): |
||
7 | @command(description="Say something as the bot!") |
||
8 | async def say( |
||
9 | self, |
||
10 | ctx: MessageContext, |
||
11 | content: CommandArg[str, Description["The content of the message"]], |
||
12 | ) -> Embed: |
||
13 | # Using the ctx to get the command author |
||
14 | return Embed(description=f"{ctx.author.user.mention} said {content}") |
||
15 | |||
16 | @Client.event |
||
17 | async def on_ready(self): |
||
18 | # Our client has successfully started, lets let ourself know that! |
||
19 | print("Logged in as", self.bot) |
||
20 | |||
21 | @Client.event |
||
22 | async def on_payload(self, payload): |
||
23 | print(payload) |
||
24 | |||
25 | |||
26 | if __name__ == "__main__": |
||
27 | Bot("ODkxNzM4NTExMzExNTE1NzA4.YVCuNA.5OrfKz5KADVhIlxMgXjSs4aQcMk").run() |
||
28 |