Show priority in list quests/side quests
This commit is contained in:
parent
cef59c494e
commit
0fdabeabda
14
bot.py
14
bot.py
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue