Repository navigation
Update commands examples - #22
Conversation
- separate simple shutdown command with error handling
PenguinBoi12
left a comment
There was a problem hiding this comment.
Those are good improvements but I think there's a few thing we could adjust.
I think this is a good PR to also add a README in the example folder explaining how to run the examples. It doesn't have to be something super complex.
There was a problem hiding this comment.
I feel like this example is a bit all over the place and command names aren't super descriptive. Also, I know we discussed separating the cooldown example and cooldown with error handling but I think I changed my mind and that in does make sense to have one cooldown example that shows how to catch error at the same time.
|
|
||
|
|
||
| # Invoke by using !cooldown_command | ||
| @bot.command(cooldown=(1, 10)) |
There was a problem hiding this comment.
I don't think we need two command for this example. Just having the first one above should be fine.
There was a problem hiding this comment.
I have two command for the reason that both are different ways to invoke the cooldown.
There was a problem hiding this comment.
Overall it looks pretty good. My only nit that I have is that we don't need print information when we ctx.reply. It's a repeated pattern and I don't think it adds much to the example:
print(f"{ctx.sender} invoked {ctx.body} in room {ctx.room_name}.")
await ctx.reply("Pong!")
...
print(f"Operation Not Allowed: {error}")
await ctx.reply(f"Operation not allowed: {error}")
...
print(f"ValueError: {error}")
await ctx.reply(f"ValueError: {error}")That's said, it's not a big deal either.
Description
This PR refactors, updates, and adds new examples for the currently available commands.
done: