🥅 Error codes

This commit is contained in:
NikolajDanger
2020-07-29 12:14:30 +02:00
parent ef434ecee8
commit b991ac0385
10 changed files with 489 additions and 280 deletions

View File

@ -20,8 +20,8 @@ def monsterFunc(command):
# 1-letter monsters don't exist
if len(command) < 2:
logThis("Monster doesn't exist in database")
return("I don't know that monster...","","","","","")
logThis("Monster name too short (error code 601)")
return("I don't know that monster... (error code 601)","","","","","")
else:
# Opens "mensters.json"
data = json.load(open('resources/monsters.json', encoding = "utf8"))
@ -117,8 +117,8 @@ def monsterFunc(command):
logThis("Returning monster information")
return(str(command),text1,text2,text3,text4,text5)
logThis("Couldn't find monster")
return("I don't know that monster...","","","","","")
logThis("Monster not in database (error code 602)")
return("I don't know that monster... (error code 602)","","","","","")
# Looks up a spell
def spellFunc(command):
@ -130,7 +130,7 @@ def spellFunc(command):
logThis("Returning spell information")
spell_output = ("***"+str(command)+"***\n*"+str(data[str(command)]["level"])+" level "+str(data[str(command)]["school"])+"\nCasting Time: "+str(data[str(command)]["casting_time"])+"\nRange: "+str(data[str(command)]["range"])+"\nComponents: "+str(data[str(command)]["components"])+"\nDuration: "+str(data[str(command)]["duration"])+"*\n \n"+str(data[str(command)]["description"]))
else:
logThis("I don't know that spell")
spell_output = "I don't think that's a spell"
logThis("I don't know that spell (error code 501)")
spell_output = "I don't think that's a spell (error code 501)"
logThis("Successfully ran !spell")
return(spell_output)