Erreur pas d'unité valide
This commit is contained in:
parent
ad54b68c07
commit
4a1a70deca
7
run.py
7
run.py
@ -25,6 +25,9 @@ class NotEnoughDoge(Exception):
|
|||||||
class AccountExisting(Exception):
|
class AccountExisting(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class NotValidUnit(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
# BlockIO
|
# BlockIO
|
||||||
|
|
||||||
version = 2
|
version = 2
|
||||||
@ -91,11 +94,15 @@ def dogetip(bot, update, args):
|
|||||||
try:
|
try:
|
||||||
if unit == "doge":
|
if unit == "doge":
|
||||||
response = transaction(update.message.from_user.username, destinataire, montant)
|
response = transaction(update.message.from_user.username, destinataire, montant)
|
||||||
|
else:
|
||||||
|
raise NotValidUnit(unit)
|
||||||
except NotEnoughDoge:
|
except NotEnoughDoge:
|
||||||
message = "Pas assez de doge @" + update.message.from_user.username
|
message = "Pas assez de doge @" + update.message.from_user.username
|
||||||
except NoAccountError as e:
|
except NoAccountError as e:
|
||||||
message = "Vous n'avez pas de compte @" + str(e) + '\n\n' \
|
message = "Vous n'avez pas de compte @" + str(e) + '\n\n' \
|
||||||
+ "Utilisez /register pour démarrer"
|
+ "Utilisez /register pour démarrer"
|
||||||
|
except NotValidUnit as e:
|
||||||
|
message = str(e) " n'est pas une unité valide"
|
||||||
else:
|
else:
|
||||||
txid = response['data']['txid']
|
txid = response['data']['txid']
|
||||||
message = '🚀 Transaction effectuée 🚀\n\n' \
|
message = '🚀 Transaction effectuée 🚀\n\n' \
|
||||||
|
Loading…
Reference in New Issue
Block a user