Fixed "$aquatic" command.

This commit is contained in:
Sheldon Lee 2020-09-24 14:00:37 +00:00
parent 476215312b
commit 05d1a813df

21
bot.py
View File

@ -18,13 +18,6 @@ def aquaticAll():
string += strToEmoji(animal) string += strToEmoji(animal)
return string 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): class Bot(discord.Client):
hangfish_instances = {} hangfish_instances = {}
@ -44,6 +37,18 @@ class Bot(discord.Client):
# Define callbacks # 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 @staticmethod
def getHangfishInstance(channel): def getHangfishInstance(channel):
return Bot.hangfish_instances.get(channel.id, None) return Bot.hangfish_instances.get(channel.id, None)
@ -76,7 +81,7 @@ class Bot(discord.Client):
# Register callbacks # Register callbacks
# #
cmd.registerCallback("aquatic", aquatic) cmd.registerCallback("aquatic", Bot.aquatic)
cmd.registerCallback("hangfish", Bot.createHangfishInstance) cmd.registerCallback("hangfish", Bot.createHangfishInstance)
cmd.registerCallback("guess", Bot.updateHangfishInstance) cmd.registerCallback("guess", Bot.updateHangfishInstance)