From 0fdabeabda1d901516a4d65a9484c760af159781 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 21 Dec 2018 21:30:24 +0530 Subject: [PATCH] Show priority in list quests/side quests --- bot.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 8cd96b5..08ad5da 100644 --- a/bot.py +++ b/bot.py @@ -194,13 +194,17 @@ def list_quests(bot, update, player, type): else: text = ("" + {"quest": "📖", "side_quest": "📒"}[type] + " List of " + {"quest": "Quests", "side_quest": - "Side Quests"}[type] + "\n") + "Side Quests"}[type] + "") x.sort(key=lambda i: (i.imp, -i.QID), reverse=True) - if type == "quest": - for i in x: + imp = 3 + for i in x: + if i.imp <= imp: + text += "\n\n📌 " + ["Low", "Medium", "High"][i.imp-1] + text += "" + imp = i.imp - 1 + if type == "quest": text += f"\n/Q_{i.QID} {i.name}" - else: - for i in x: + else: text += f"\n/SQ_{i.QID} {i.name}" chat_id = update.message.chat_id