Gestion erreurs
This commit is contained in:
parent
e5a448118a
commit
6964bcd702
15
run.py
15
run.py
@ -92,12 +92,15 @@ def dogetip(bot, update, args):
|
|||||||
if unit == "doge":
|
if unit == "doge":
|
||||||
response = transaction(update.message.from_user.username, destinataire, montant)
|
response = transaction(update.message.from_user.username, destinataire, montant)
|
||||||
|
|
||||||
txid = response['data']['txid']
|
try:
|
||||||
|
txid = response['data']['txid']
|
||||||
message = '🚀 Transaction effectuée 🚀\n\n' \
|
except TypeError:
|
||||||
+ str(montant) + ' ' + NETWORK + '\n' \
|
message = response
|
||||||
+ '@' + update.message.from_user.username + ' → @' + destinataire + '\n\n' \
|
else:
|
||||||
+ '<a href="https://chain.so/tx/' + NETWORK + '/' + txid + '">Voir la transaction</a>'
|
message = '🚀 Transaction effectuée 🚀\n\n' \
|
||||||
|
+ str(montant) + ' ' + NETWORK + '\n' \
|
||||||
|
+ '@' + update.message.from_user.username + ' → @' + destinataire + '\n\n' \
|
||||||
|
+ '<a href="https://chain.so/tx/' + NETWORK + '/' + txid + '">Voir la transaction</a>'
|
||||||
|
|
||||||
bot.send_message(chat_id=update.message.chat_id, parse_mode=ParseMode.HTML, text=message)
|
bot.send_message(chat_id=update.message.chat_id, parse_mode=ParseMode.HTML, text=message)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user