mirror of
https://git.wownero.com/lza_menace/tg-bot.git
synced 2024-08-15 00:23:12 +00:00
revamp - bring the bot to life again
This commit is contained in:
parent
594407c204
commit
a6f858671e
14 changed files with 97 additions and 49 deletions
|
@ -22,8 +22,11 @@ def check_debug(f):
|
|||
def log_event(f):
|
||||
@wraps(f)
|
||||
def decorated_function(*args, **kwargs):
|
||||
_d = ''
|
||||
if config.DEBUG:
|
||||
_d = ' (debug mode on)'
|
||||
msg = args[0].message
|
||||
logging.info(f'"{f.__name__}" invoked from {msg.from_user["id"]} ({msg.from_user["first_name"]}) - Full command: "{msg.text}"')
|
||||
logging.info(f'"{f.__name__}" invoked from {msg.from_user["id"]} ({msg.from_user["first_name"]}) - Full command: "{msg.text}"{_d}')
|
||||
return f(*args, **kwargs)
|
||||
return decorated_function
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
from base64 import b64encode
|
||||
from qrcode import make as qrcode_make
|
||||
|
||||
from tipbot import config
|
||||
|
||||
def is_tg_admin(chat_id):
|
||||
|
@ -5,3 +11,9 @@ def is_tg_admin(chat_id):
|
|||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def generate_qr(s):
|
||||
_address_qr = BytesIO()
|
||||
qrcode_make(s).save(_address_qr, format="PNG")
|
||||
_address_qr.seek(0)
|
||||
return _address_qr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue