Change text if no quests/side quests exist
This commit is contained in:
parent
28d2dc4244
commit
c4d1452f8a
9
bot.py
9
bot.py
|
@ -183,8 +183,13 @@ def list_quests(bot, update, player, type):
|
||||||
x = player.get_side_quests(0)
|
x = player.get_side_quests(0)
|
||||||
else:
|
else:
|
||||||
raise ValueError('Not quest or side_quest')
|
raise ValueError('Not quest or side_quest')
|
||||||
text = "<b>List of " + {"quest": "Quests", "side_quest":
|
if len(x) == 0:
|
||||||
"Side Quests"}[type] + "</b>\n"
|
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)
|
x.sort(key=lambda i: (i.imp, -i.QID), reverse=True)
|
||||||
if type == "quest":
|
if type == "quest":
|
||||||
for i in x:
|
for i in x:
|
||||||
|
|
Loading…
Reference in New Issue