mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Catch discord error, make "all" match uppercase
This commit is contained in:
parent
dc7e982491
commit
f6d06eb489
4 changed files with 6 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue