From 67a0f8f06881ab35b7b2fbe8074198f19a7d770d Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 14 Mar 2019 10:41:28 +0300 Subject: [PATCH] fixes --- main.py | 2 +- send_users_list.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 0c5f7f1..47a6732 100755 --- a/main.py +++ b/main.py @@ -188,7 +188,7 @@ def _process_message(bot: Bot, m: Message): del conn.root.users[uid] commit() bot.send_message(MANAGEMENT_CHAT, f'{name} был удален ' - f'из-за блокировки бота') + f'из-за блокировки бота', parse_mode='html') except TelegramError: sentry_sdk.capture_exception() diff --git a/send_users_list.py b/send_users_list.py index d82ccbc..b4719e3 100755 --- a/send_users_list.py +++ b/send_users_list.py @@ -6,8 +6,9 @@ from db import get_conn, Subscriber from config import BOT_TOKEN, MANAGEMENT_CHAT -def send_users_list(bot: Bot = None): - conn = get_conn(read_only=True) +def send_users_list(bot: Bot = None, conn=None): + if conn is None: + conn = get_conn(read_only=True) if not bot: bot = Bot(BOT_TOKEN)