Catch discord error, make "all" match uppercase

This commit is contained in:
Stijn De Clercq 2021-05-16 12:15:45 +02:00
parent dc7e982491
commit f6d06eb489
4 changed files with 6 additions and 6 deletions

View file

@ -70,7 +70,7 @@ class Bitcoin(commands.Cog):
if not resp[0]:
return await ctx.send(resp[1])
if amount == "all":
if str(amount).lower() == "all":
amount = resp[1]
# Calculate the amount of Bitcoins the user can buy with [amount] of Didier Dinks
@ -93,7 +93,7 @@ class Bitcoin(commands.Cog):
:param ctx: Discord Context
:param amount: the amount of Bitcoins the user wants to sell
"""
if amount == "all":
if str(amount).lower() == "all":
amount = float(currency.getOrAddUser(ctx.author.id)[8])
try:

View file

@ -288,7 +288,7 @@ class Dinks(commands.Cog):
await ctx.send(checks.isValidAmount(ctx, amount[0])[1])
else:
user = currency.getOrAddUser(ctx.author.id)
if amount[0] == "all":
if str(amount[0]).lower() == "all":
amount[0] = user[1]
amount[0] = float(amount[0])

View file

@ -116,7 +116,7 @@ class Events(commands.Cog):
elif isinstance(err, (commands.ChannelNotFound, commands.ChannelNotReadable)):
await ctx.send("Geen channel gevonden dat overeenkomt met het opgegeven argument.")
# Someone forgot an argument or passed an invalid argument
elif isinstance(err, (commands.BadArgument, commands.MissingRequiredArgument)):
elif isinstance(err, (commands.BadArgument, commands.MissingRequiredArgument, commands.UnexpectedQuoteError)):
await ctx.send("Controleer je argumenten.")
else:
# Remove the InvokeCommandError because it's useless information