aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Nash <[email protected]>2020-06-10 15:56:00 -0500
committerGravatar Daniel Nash <[email protected]>2020-06-10 15:56:21 -0500
commitb2195f1990c6720dad6819cc118920b89e24beba (patch)
treea685129143ab701d16354a40d6b701d8b3a28c5c
parentUpdate example to not be in a cog (diff)
Move the not rate-limited message into else
-rw-r--r--bot/resources/tags/customcooldown.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/resources/tags/customcooldown.md b/bot/resources/tags/customcooldown.md
index 35f28a1e5..b44d6b12f 100644
--- a/bot/resources/tags/customcooldown.md
+++ b/bot/resources/tags/customcooldown.md
@@ -13,8 +13,10 @@ async def on_message(message):
retry_after = bucket.update_rate_limit()
if retry_after:
await message.channel.send("Slow down! You're sending messages too fast")
+ else:
+ # you're not rate limited
pass
- # you're not rate limited
+ # more code here
```
`from_cooldown` takes the amount of `update_rate_limit()`s needed to trigger the cooldown, the time in which the cooldown is triggered, and a [`BucketType`](discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.discord.ext.commands.BucketType).