Show priority in list quests/side quests

This commit is contained in:
Ceda EI 2018-12-21 21:30:24 +05:30
parent cef59c494e
commit 0fdabeabda
1 changed files with 9 additions and 5 deletions

14
bot.py
View File

@ -194,13 +194,17 @@ def list_quests(bot, update, player, type):
else: else:
text = ("<b>" + {"quest": "📖", "side_quest": "📒"}[type] + text = ("<b>" + {"quest": "📖", "side_quest": "📒"}[type] +
" List of " + {"quest": "Quests", "side_quest": " List of " + {"quest": "Quests", "side_quest":
"Side Quests"}[type] + "</b>\n") "Side Quests"}[type] + "</b>")
x.sort(key=lambda i: (i.imp, -i.QID), reverse=True) x.sort(key=lambda i: (i.imp, -i.QID), reverse=True)
if type == "quest": imp = 3
for i in x: for i in x:
if i.imp <= imp:
text += "\n\n<b>📌 " + ["Low", "Medium", "High"][i.imp-1]
text += "</b>"
imp = i.imp - 1
if type == "quest":
text += f"\n/Q_{i.QID} {i.name}" text += f"\n/Q_{i.QID} {i.name}"
else: else:
for i in x:
text += f"\n/SQ_{i.QID} {i.name}" text += f"\n/SQ_{i.QID} {i.name}"
chat_id = update.message.chat_id chat_id = update.message.chat_id