diff --git a/bot.py b/bot.py index f6ac0ab..ae1a925 100644 --- a/bot.py +++ b/bot.py @@ -71,7 +71,7 @@ def update_message(bot, db, callback_id): reply_markup=keyboard) -def send_stats(bot, update, db): +def send_stats(bot, update, db, tag): cursor = db.cursor() query = ("SELECT user_id, name FROM poll NATURAL JOIN message_ids WHERE " "message_id = ?") @@ -84,7 +84,10 @@ def send_stats(bot, update, db): else: text = "Voters\n" for i in voters: - text += f"{i[1]}\n" + if tag: + text += f"{i[1]}\n" + else: + text += f"{i[1]}\n" bot.send_message(chat_id=update.message.chat_id, text=text, parse_mode="HTML") @@ -95,7 +98,8 @@ def post(bot, update, db): if (update.message.forward_from_chat and update.message.forward_from_chat.id == config.channel_id and user_id in config.allowed_users): - send_stats(bot, update, db) + tag = (chat_id == user_id) + send_stats(bot, update, db, tag) return if chat_id in config.allowed_users: callback_id = get_callback_id(db)