spits out raw item string if not found in languages.json
This commit is contained in:
parent
41a61117cc
commit
4c5fc3d98b
17
warbot.py
17
warbot.py
|
@ -110,14 +110,21 @@ class WarBot(irc.IRCClient):
|
|||
minLvl = info["minEnemyLevel"]
|
||||
maxLvl = info["maxEnemyLevel"]
|
||||
credits = info["missionReward"].get("credits")
|
||||
items = info["missionReward"].get("items", [])
|
||||
if items:
|
||||
items = [self.languages[item.lower()]["value"] for item in items]
|
||||
cItems = info["missionReward"].get("countedItems")
|
||||
if cItems:
|
||||
items_raw = info["missionReward"].get("items", [])
|
||||
items = []
|
||||
for item in items_raw:
|
||||
try:
|
||||
items.append(self.languages[item.lower()]["value"])
|
||||
except KeyError:
|
||||
items.append(item)
|
||||
|
||||
cItems = info["missionReward"].get("countedItems", [])
|
||||
for item in cItems:
|
||||
itemStr = f"({item['ItemCount']}) "
|
||||
try:
|
||||
itemStr += self.languages[item["ItemType"].lower()]["value"]
|
||||
except KeyError:
|
||||
itemStr += item["ItemType"]
|
||||
items.append(itemStr)
|
||||
|
||||
expire = int(alert["Expiry"]["$date"]["$numberLong"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user