Removed cooldown command for waifu images

Added more comments
pull/2/head
sgoudham 5 years ago
parent fdd96a86aa
commit ee15df9a47

@ -4,7 +4,6 @@ import random
import discord import discord
from discord.ext import commands from discord.ext import commands
from discord.ext.commands import BucketType, cooldown
channels = ["bot-commands"] channels = ["bot-commands"]
@ -22,10 +21,10 @@ class Waifus(commands.Cog):
# Bot ~Kakashi command for Zara # Bot ~Kakashi command for Zara
@commands.command(aliases=['Kakashi']) @commands.command(aliases=['Kakashi'])
@cooldown(1, 0, BucketType.channel)
async def kakashi(self, ctx): async def kakashi(self, ctx):
try: try:
with open('images/kakashiImages.txt') as file: with open('images/kakashiImages.txt') as file:
kakashi_array = file.readlines() kakashi_array = file.readlines()
@ -49,12 +48,12 @@ class Waifus(commands.Cog):
await asyncio.sleep(2.5) await asyncio.sleep(2.5)
# Delete the message # Delete the message
await message.delete() await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
# Bot ~Toga command for Josh # Bot ~Toga command for Josh
@commands.command(aliases=['Toga']) @commands.command(aliases=['Toga'])
@cooldown(1, 0, BucketType.channel)
async def toga(self, ctx): async def toga(self, ctx):
try: try:
@ -81,12 +80,12 @@ class Waifus(commands.Cog):
await asyncio.sleep(2.5) await asyncio.sleep(2.5)
# Delete the message # Delete the message
await message.delete() await message.delete()
except FileNotFoundError as e: except FileNotFoundError as e:
print(e) print(e)
# Bot ~Tamaki command for Kate # Bot ~Tamaki command for Kate
@commands.command(aliases=['Tamaki']) @commands.command(aliases=['Tamaki'])
@cooldown(1, 0, BucketType.channel)
async def tamaki(self, ctx): async def tamaki(self, ctx):
try: try:
@ -117,6 +116,7 @@ class Waifus(commands.Cog):
print(e) print(e)
# Error handling function to make sure that the commands only work in bot-commands
def error_function(): def error_function():
return "Sorry! I only work in #bot-commands!" return "Sorry! I only work in #bot-commands!"

Loading…
Cancel
Save