From 05d1a813df9f77f0939b859334b64516ffc2615e Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Thu, 24 Sep 2020 14:00:37 +0000 Subject: [PATCH] Fixed "$aquatic" command. --- bot.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bot.py b/bot.py index 1010328..0ef3843 100644 --- a/bot.py +++ b/bot.py @@ -18,13 +18,6 @@ def aquaticAll(): string += strToEmoji(animal) return string -def aquatic(*args): - if len(args) > 0: - if args[0] == "-a": return aquaticAll() - else: return "Unknown Argument: {}".format(args[0]) - return randomAquatic() - - class Bot(discord.Client): hangfish_instances = {} @@ -44,6 +37,18 @@ class Bot(discord.Client): # Define callbacks # + @staticmethod + async def aquatic(channel, *args): + # Options + if len(args) > 0: + if args[0] == "-a": + await channel.send(aquaticAll()) + else: + await channel.send("Unknown Argument: {}".format(args[0])) + # Default option + else: + await channel.send(randomAquatic()) + @staticmethod def getHangfishInstance(channel): return Bot.hangfish_instances.get(channel.id, None) @@ -76,7 +81,7 @@ class Bot(discord.Client): # Register callbacks # -cmd.registerCallback("aquatic", aquatic) +cmd.registerCallback("aquatic", Bot.aquatic) cmd.registerCallback("hangfish", Bot.createHangfishInstance) cmd.registerCallback("guess", Bot.updateHangfishInstance)