From 7a51607ff84dbd2c9189b52f3533b8bb4457b548 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Thu, 18 Jun 2020 04:49:04 +0100 Subject: [PATCH] Trying to get errorFunction to work --- EnsoBot.py | 5 ----- cogs/Embeds.py | 6 +++++- cogs/FunCommands.py | 2 +- cogs/WaifuImages.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/EnsoBot.py b/EnsoBot.py index ce57a5e7..a718322d 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -198,11 +198,6 @@ async def on_raw_reaction_remove(payload): print(e) -# Error handling function to make sure that the commands only work in enso-chan-commands -def error_function(): - return "Sorry! I only work in #enso-chan-commands!" - - # Run the bot, allowing to come online try: client.run(API_TOKEN) diff --git a/cogs/Embeds.py b/cogs/Embeds.py index d5633a3a..a8412e4c 100644 --- a/cogs/Embeds.py +++ b/cogs/Embeds.py @@ -7,7 +7,6 @@ from discord.ext import commands from discord.ext.commands import BucketType, cooldown import config -from EnsoBot import error_function colour_list = [c for c in config.colors.values()] channels = ["enso-chan-commands", 'general'] @@ -154,5 +153,10 @@ class Embeds(commands.Cog): print(e) +# Error handling function to make sure that the commands only work in enso-chan-commands +def error_function(): + return "Sorry! I only work in #enso-chan-commands!" + + def setup(bot): bot.add_cog(Embeds(bot)) diff --git a/cogs/FunCommands.py b/cogs/FunCommands.py index b3e2a664..725d62a5 100644 --- a/cogs/FunCommands.py +++ b/cogs/FunCommands.py @@ -6,7 +6,7 @@ from discord.ext import commands from discord.ext.commands import BucketType, cooldown import config -from EnsoBot import error_function +from cogs.Embeds import error_function colour_list = [c for c in config.colors.values()] diff --git a/cogs/WaifuImages.py b/cogs/WaifuImages.py index e7d5071c..83b0adfe 100644 --- a/cogs/WaifuImages.py +++ b/cogs/WaifuImages.py @@ -8,7 +8,7 @@ from discord.ext import commands from discord.ext.commands import cooldown, BucketType import config -from EnsoBot import error_function +from cogs.Embeds import error_function channels = ["enso-chan-commands"]