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"]
|
minLvl = info["minEnemyLevel"]
|
||||||
maxLvl = info["maxEnemyLevel"]
|
maxLvl = info["maxEnemyLevel"]
|
||||||
credits = info["missionReward"].get("credits")
|
credits = info["missionReward"].get("credits")
|
||||||
items = info["missionReward"].get("items", [])
|
items_raw = info["missionReward"].get("items", [])
|
||||||
if items:
|
items = []
|
||||||
items = [self.languages[item.lower()]["value"] for item in items]
|
for item in items_raw:
|
||||||
cItems = info["missionReward"].get("countedItems")
|
try:
|
||||||
if cItems:
|
items.append(self.languages[item.lower()]["value"])
|
||||||
|
except KeyError:
|
||||||
|
items.append(item)
|
||||||
|
|
||||||
|
cItems = info["missionReward"].get("countedItems", [])
|
||||||
for item in cItems:
|
for item in cItems:
|
||||||
itemStr = f"({item['ItemCount']}) "
|
itemStr = f"({item['ItemCount']}) "
|
||||||
|
try:
|
||||||
itemStr += self.languages[item["ItemType"].lower()]["value"]
|
itemStr += self.languages[item["ItemType"].lower()]["value"]
|
||||||
|
except KeyError:
|
||||||
|
itemStr += item["ItemType"]
|
||||||
items.append(itemStr)
|
items.append(itemStr)
|
||||||
|
|
||||||
expire = int(alert["Expiry"]["$date"]["$numberLong"])
|
expire = int(alert["Expiry"]["$date"]["$numberLong"])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user