mirror of
https://git.wownero.com/lza_menace/tg-bot.git
synced 2024-08-15 00:23:12 +00:00
add debug mode option to disable the bot when developing locally
This commit is contained in:
parent
eca06caf75
commit
928f7b00af
8 changed files with 29 additions and 7 deletions
|
@ -1,12 +1,13 @@
|
|||
import logging
|
||||
from tipbot import wownero
|
||||
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, check_debug
|
||||
|
||||
|
||||
@wallet_rpc_required
|
||||
@registration_required
|
||||
@log_event
|
||||
@check_debug
|
||||
def balance(update, context):
|
||||
u = db.User.get(telegram_id=update.message.from_user['id'])
|
||||
balances = wownero.Wallet().balances(account=u.account_index)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from tipbot.helpers.decorators import wallet_rpc_required, log_event
|
||||
from tipbot.helpers.decorators import wallet_rpc_required, log_event, check_debug
|
||||
from tipbot.helpers.utils import is_tg_admin
|
||||
|
||||
|
||||
@wallet_rpc_required
|
||||
@log_event
|
||||
@check_debug
|
||||
def debug(update, context):
|
||||
if is_tg_admin(update.message.from_user['id']):
|
||||
pass
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import logging
|
||||
from tipbot import wownero
|
||||
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, check_debug
|
||||
|
||||
|
||||
@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]
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import logging
|
||||
from tipbot import wownero
|
||||
from tipbot import db
|
||||
from tipbot.helpers.decorators import wallet_rpc_required, log_event
|
||||
from tipbot.helpers.decorators import wallet_rpc_required, log_event, check_debug
|
||||
|
||||
|
||||
@wallet_rpc_required
|
||||
@log_event
|
||||
@check_debug
|
||||
def register(update, context):
|
||||
uid = update.message.from_user['id']
|
||||
un = update.message.from_user['first_name']
|
||||
|
|
|
@ -3,12 +3,13 @@ from decimal import Decimal
|
|||
from telegram import ParseMode
|
||||
from tipbot import wownero
|
||||
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, check_debug
|
||||
|
||||
|
||||
@wallet_rpc_required
|
||||
@registration_required
|
||||
@log_event
|
||||
@check_debug
|
||||
def tip(update, context):
|
||||
if len(context.args) < 2:
|
||||
update.message.reply_text('Not enough arguments passed.')
|
||||
|
|
|
@ -3,12 +3,13 @@ from decimal import Decimal
|
|||
from telegram import ParseMode
|
||||
from tipbot import wownero
|
||||
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, check_debug
|
||||
|
||||
|
||||
@wallet_rpc_required
|
||||
@registration_required
|
||||
@log_event
|
||||
@check_debug
|
||||
def withdraw(update, context):
|
||||
if len(context.args) < 2:
|
||||
update.message.reply_text('Not enough arguments passed.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue