diff --git a/EnsoBot.py b/EnsoBot.py index 5308e212..87c289f7 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -78,7 +78,17 @@ async def on_command_error(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 1.5 seconds + # Let the user read the message for 2.5 seconds + await asyncio.sleep(2.5) + # Delete the message + await message.delete() + +@client.event +async def on_command_error(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() diff --git a/cogs/FunCommands.py b/cogs/FunCommands.py index 0cb7936b..0b1748f9 100644 --- a/cogs/FunCommands.py +++ b/cogs/FunCommands.py @@ -1,4 +1,5 @@ import random +import asyncio from discord.ext import commands from discord.ext.commands import BucketType, cooldown @@ -12,7 +13,13 @@ class Fun(commands.Cog): @cooldown(1, 3, BucketType.channel) async def _8ball(self, ctx, *, question): channels = ["bot-commands"] - if str(ctx.channel) in channels: + if str(ctx.channel) not in channels: + message = await ctx.send("Sorry! I only work in #bot-commands!") + + # Let the user read the message for 2.5 seconds + await asyncio.sleep(2.5) + # Delete the message + await message.delete() responses = [ "Hamothy is preoccupied with catching a case", "The prophet Kate believes it will come true", @@ -69,6 +76,7 @@ class Fun(commands.Cog): "Hamothy has used his godlike like powers to align the stars for you, it must be true", "Gabriel appears out of thin air and smites you", "Yes yes yes!!!", + "No I don't care about your question, where is my podcast!??!?" ] await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}') diff --git a/cogs/WaifuImages.py b/cogs/WaifuImages.py index b0d785ab..8c64b80d 100644 --- a/cogs/WaifuImages.py +++ b/cogs/WaifuImages.py @@ -1,4 +1,5 @@ import random +import asyncio import discord from discord.ext import commands from discord.ext.commands import BucketType, cooldown @@ -13,6 +14,14 @@ class Waifus(commands.Cog): @cooldown(1, 5, BucketType.channel) async def kakashi(self, ctx): channels = ["bot-commands"] + if str(ctx.channel) not in channels: + message = await ctx.send("Sorry! I only work in #bot-commands!") + + # Let the user read the message for 2.5 seconds + await asyncio.sleep(2.5) + # Delete the message + await message.delete() + if str(ctx.channel) in channels: kakashi1 = "https://cdn.discordapp.com/attachments/714671068941647933/717201077346238514/image0.jpg" kakashi2 = "https://cdn.discordapp.com/attachments/714671068941647933/717201077669331036/image1.jpg" diff --git a/cogs/__pycache__/FunCommands.cpython-36.pyc b/cogs/__pycache__/FunCommands.cpython-36.pyc index 154462c8..466e1643 100644 Binary files a/cogs/__pycache__/FunCommands.cpython-36.pyc and b/cogs/__pycache__/FunCommands.cpython-36.pyc differ diff --git a/cogs/__pycache__/WaifuImages.cpython-36.pyc b/cogs/__pycache__/WaifuImages.cpython-36.pyc index 60eb4527..e24c9850 100644 Binary files a/cogs/__pycache__/WaifuImages.cpython-36.pyc and b/cogs/__pycache__/WaifuImages.cpython-36.pyc differ