From 342da9012cd1b100136314534240250941691bcf Mon Sep 17 00:00:00 2001 From: sgoudham Date: Tue, 2 Jun 2020 13:59:02 +0100 Subject: [PATCH] Trying to make it only bot commands --- EnsoBot.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/EnsoBot.py b/EnsoBot.py index cee8f192..75f12a43 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -1,5 +1,6 @@ import discord import asyncio +import sys import random from discord.ext import commands from discord.ext.commands import BucketType, cooldown @@ -153,10 +154,23 @@ async def kakashi(ctx): kakashi31, kakashi32, kakashi33, kakashi34, kakashi35, kakashi36, kakashi37, kakashi38, kakashi39, kakashi40] + if ctx != client.get_channel(669812887564320769): + await ctx.send('Sorry, I only work in Bot Commands!') + await error() + embed = discord.Embed(title="```Random Kakashi Image```", colour=discord.Colour(0xff0000), ) embed.set_image(url=random.choice(kakashiArray)) await ctx.send(embed=embed) +@client.event +async def error(ctx): + message = await ctx.send('Sorry, I only work in Bot Commands!') + + # Let the user read the message for 1.5 seconds + await asyncio.sleep(1.5) + ## delete the message + await message.delete() + # Bot Event for handling cooldown error @client.event