Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

Commit 1326241

Browse files
committed
[example] Update example
1 parent dde2821 commit 1326241

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

examples/basic.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ async def main(self, ctx, msg: str = ";-;"):
4141
await ctx.send(msg)
4242

4343
async def subcommand_before_invoke(self, ctx):
44-
await ctx.send("Test before hook PASS")
44+
await ctx.send("=======echo=======")
4545

4646
async def subcommand_after_invoke(self, ctx):
47-
await ctx.send("Test after hook PASS")
47+
await ctx.send("=====echo end=====")
4848

4949
@disctools.inject(name="becho")
5050
class better_echo(disctools.Command):
@@ -64,4 +64,9 @@ async def simple_echo(self, ctx, *, msg: str = "*silence echoes*"):
6464
"""Echo but dead simple - [p]echo secho [msg]"""
6565
return await ctx.send(msg)
6666

67+
@simple_echo.error
68+
async def on_err(self, ctx, err):
69+
await ctx.send("Something went wrong")
70+
print(err)
71+
6772
Bot.run("<TOKEN>")

0 commit comments

Comments
 (0)