Don't tag in group
This commit is contained in:
parent
b71174918b
commit
579fafd7b1
10
bot.py
10
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"<a href='tg://user?id={i[0]}'>{i[1]}</a>\n"
|
||||
if tag:
|
||||
text += f"<a href='tg://user?id={i[0]}'>{i[1]}</a>\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)
|
||||
|
|
Loading…
Reference in New Issue