You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
677 B
Python
22 lines
677 B
Python
import logging
|
|
from telegram import ParseMode
|
|
from tipbot import wownero
|
|
from tipbot import db
|
|
from tipbot.helpers.decorators import wallet_rpc_required, log_event, registration_required, check_debug
|
|
from tipbot.helpers.utils import generate_qr
|
|
|
|
|
|
@wallet_rpc_required
|
|
@registration_required
|
|
@log_event
|
|
@check_debug
|
|
def deposit(update, context):
|
|
u = db.User.get(telegram_id=update.message.from_user['id'])
|
|
address = wownero.Wallet().addresses(account=u.account_index)[0]
|
|
update.message.from_user.send_photo(
|
|
photo=generate_qr(address),
|
|
caption=f'{u.telegram_user}\'s deposit address: {address}',
|
|
quote=False
|
|
)
|
|
update.message.delete()
|