|
|
@ -1,5 +1,6 @@
|
|
|
|
import logging
|
|
|
|
import logging
|
|
|
|
from decimal import Decimal
|
|
|
|
from decimal import Decimal
|
|
|
|
|
|
|
|
from telegram import ParseMode
|
|
|
|
from tipbot import wownero
|
|
|
|
from tipbot import wownero
|
|
|
|
from tipbot import db
|
|
|
|
from tipbot import db
|
|
|
|
from tipbot.helpers.decorators import wallet_rpc_required, log_event, registration_required
|
|
|
|
from tipbot.helpers.decorators import wallet_rpc_required, log_event, registration_required
|
|
|
@ -61,9 +62,11 @@ def tip(update, context):
|
|
|
|
tx = wownero.Wallet().transfer(dest_address=address, amount=wownero.as_wownero(amount), priority=2, account=tipper.account_index)
|
|
|
|
tx = wownero.Wallet().transfer(dest_address=address, amount=wownero.as_wownero(amount), priority=2, account=tipper.account_index)
|
|
|
|
if 'tx_hash' in tx:
|
|
|
|
if 'tx_hash' in tx:
|
|
|
|
h = tx['tx_hash']
|
|
|
|
h = tx['tx_hash']
|
|
|
|
update.message.reply_text(f'Tipped @{target_un} {amount} WOW! TX ID: [{h}](https://wownero.xmrauctions.com/transaction/{h})')
|
|
|
|
msg = f'Tipped @{target_un} {amount} WOW! TX ID: [{h}](https://wownero.xmrauctions.com/transaction/{h})'
|
|
|
|
|
|
|
|
update.message.reply_text(msg, parse_mode=ParseMode.MARKDOWN_V2)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
update.message.reply_text('Failed to send a tip. Ask for help.')
|
|
|
|
logging.error(f'Transaction failure details for {tipper.telegram_user} ({tipper.telegram_id}): {tx}')
|
|
|
|
|
|
|
|
update.message.reply_text(f'Failed to send a tip. Reason: "{tx["message"]}"')
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
logging.error(f'Unable to send transfer: {e}. Debug: {update.message}')
|
|
|
|
logging.error(f'Unable to send transfer: {e}. Debug: {update.message}')
|
|
|
|
update.message.reply_text('Failed to send a tip. Ask for help.')
|
|
|
|
update.message.reply_text('Failed to send a tip. Ask for help.')
|
|
|
|