Added more commentary

pull/2/head
sgoudham 5 years ago
parent 43d578b844
commit c9247270d7

@ -2,7 +2,7 @@ import random
from discord.ext import commands
# OwO Impowt da wibwawy ÙωÙ
from discord.ext.commands import cooldown, BucketType
from discord.ext.commands import BucketType
from owotext import OwO
# Defining an array of all the vowels in lowercase and uppercase
@ -44,7 +44,7 @@ class OwOText(commands.Cog):
# ~owo command allows for text to be 'converted to OWO'
@commands.command()
@cooldown(1, 1, BucketType.user)
@commands.cooldown(1, 1, BucketType.user)
async def owo(self, ctx):
if ctx.message.content.startswith("~owo"):
msg = ctx.message.content.split("~owo ", 1)
@ -55,5 +55,18 @@ class OwOText(commands.Cog):
await ctx.message.channel.send(owo)
""" # Bot Event for handling cooldown error
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
message = await ctx.send(f'That command is on cooldown. Try again in {error.retry_after:,.2f} seconds.')
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
"""
def setup(bot):
bot.add_cog(OwOText(bot))

Loading…
Cancel
Save