This commit is contained in:
bakatrouble 2021-04-01 11:25:31 +03:00
parent 37fe31b481
commit cf62821e23

View File

@ -101,7 +101,7 @@ def add_user(update: Update, ctx: CallbackContext):
user = _add_user(ctx.bot, uid) user = _add_user(ctx.bot, uid)
if update.callback_query: if update.callback_query:
update.callback_query.message.edit_reply_markup() update.callback_query.message.edit_reply_markup()
ctx.bot.send_message(MANAGEMENT_CHAT, f'<a href="tg://user?id={uid}">{escape(user.name)}</a> был добавлен', ctx.bot.send_message(MANAGEMENT_CHAT, f'<a href="tg://user?id={uid}">{escape(user.name)}</a> ({uid}) был добавлен',
parse_mode='html') parse_mode='html')
ctx.bot.send_message(uid, 'Добро пожаловать. Снова.') ctx.bot.send_message(uid, 'Добро пожаловать. Снова.')
except TelegramError as e: except TelegramError as e:
@ -242,7 +242,7 @@ def users_list(update: Update, ctx: CallbackContext):
with open('fake_users.json') as f: with open('fake_users.json') as f:
subs = {data[0]: Subscriber(int(data[0]), data[1]) for data in json.load(f).items()} subs = {data[0]: Subscriber(int(data[0]), data[1]) for data in json.load(f).items()}
except: except:
subs = conn.root.subscribers.values() subs = conn.root.subscribers
messages = [f'Count: {len(subs)}\n'] messages = [f'Count: {len(subs)}\n']
for sub in subs.values(): # type: Subscriber for sub in subs.values(): # type: Subscriber