|
|
@ -168,20 +168,19 @@ def send(update, context):
|
|
|
|
update.message.reply_text('Bad Wownero amount specified. Provide only positive integers or decimals greater than or equal to 1.')
|
|
|
|
update.message.reply_text('Bad Wownero amount specified. Provide only positive integers or decimals greater than or equal to 1.')
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
tipper = db.User.get(telegram_id=update.message.from_user['id'])
|
|
|
|
sender = db.User.get(telegram_id=update.message.from_user['id'])
|
|
|
|
tipper_balances = wownero.Wallet().balances(account=tipper.account_index)
|
|
|
|
sender_balances = wownero.Wallet().balances(account=sender.account_index)
|
|
|
|
if amount > tipper_balances[1]:
|
|
|
|
if amount > sender_balances[1]:
|
|
|
|
update.message.reply_text(f'You do not have sufficient funds to send {amount} WOW. Check your /balance')
|
|
|
|
update.message.reply_text(f'You do not have sufficient funds to send {amount} WOW. Check your /balance')
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
# transfer funds to given address
|
|
|
|
# transfer funds to given address
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
tx = wownero.Wallet().transfer(dest_address=address, amount=amount, priority=2, account=u.account_index)
|
|
|
|
tx = wownero.Wallet().transfer(dest_address=address, amount=amount, priority=2, account=sender.account_index)
|
|
|
|
print(tx)
|
|
|
|
update.message.reply_text(f'Sent {amount} WOW! Tx: {tx}')
|
|
|
|
update.message.reply_text(f'@{update.message.from_user["username"]} has tipped @{target_un} {amount} WOW!')
|
|
|
|
|
|
|
|
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 Wownero. Ask for help.')
|
|
|
|
|
|
|
|
|
|
|
|
@wallet_rpc_required
|
|
|
|
@wallet_rpc_required
|
|
|
|
@registration_required
|
|
|
|
@registration_required
|
|
|
|