aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Nash <[email protected]>2020-06-10 17:09:17 -0500
committerGravatar GitHub <[email protected]>2020-06-10 17:09:17 -0500
commit76da8f09c7c8d62f8451bc561f020f489b3a0970 (patch)
treeaa114f55530a4b253070ecaa0529136e0dbf9394
parentMove the not rate-limited message into else (diff)
change _cd to message_cooldown
Apply suggestions from code review Co-authored-by: Joseph Banks <[email protected]>
-rw-r--r--bot/resources/tags/customcooldown.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/resources/tags/customcooldown.md b/bot/resources/tags/customcooldown.md
index b44d6b12f..f304de246 100644
--- a/bot/resources/tags/customcooldown.md
+++ b/bot/resources/tags/customcooldown.md
@@ -5,11 +5,11 @@ Cooldowns can be used in discord.py to rate-limit. In this example, we're using
```python
from discord.ext import commands
-_cd = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)
+message_cooldown = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)
@bot.event
async def on_message(message):
- bucket = _cd.get_bucket(message)
+ bucket = message_cooldown.get_bucket(message)
retry_after = bucket.update_rate_limit()
if retry_after:
await message.channel.send("Slow down! You're sending messages too fast")