Change text if no quests/side quests exist

This commit is contained in:
Ceda EI 2018-11-04 18:35:56 +05:30
parent 28d2dc4244
commit c4d1452f8a
1 changed files with 7 additions and 2 deletions

5
bot.py
View File

@ -183,6 +183,11 @@ def list_quests(bot, update, player, type):
x = player.get_side_quests(0)
else:
raise ValueError('Not quest or side_quest')
if len(x) == 0:
text = ("<b>You have completed every " +
{"quest": "Quests", "side_quest": "Side Quests"}[type] +
" ever known to me.</b>")
else:
text = "<b>List of " + {"quest": "Quests", "side_quest":
"Side Quests"}[type] + "</b>\n"
x.sort(key=lambda i: (i.imp, -i.QID), reverse=True)