per
This commit is contained in:
parent
373aeb1043
commit
29fcf1df35
9
main.py
9
main.py
@ -78,9 +78,12 @@ def set_probability(message: Message):
|
||||
bot.send_message(message.chat.id, "В этом чате я пока никому не парировал")
|
||||
return
|
||||
text = "Вот кому я парировал:\n"
|
||||
total = mongo.counter_collection.count_documents({"chat_id": message.chat.id})
|
||||
for index, value in enumerate(rating):
|
||||
text += f"{index + 1}. @{value['username']} - {value['count']} ({int(value['count'] / total * 100)})%\n"
|
||||
rating_arr = list(enumerate(rating))
|
||||
total = 0
|
||||
for _, value in rating_arr:
|
||||
total += value['count']
|
||||
for index, value in rating_arr:
|
||||
text += f"{index + 1}. @{value['username']} - {value['count']} ({int(value['count'] / total * 100)}%)\n"
|
||||
bot.send_message(message.chat.id, text)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user