🥅 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

@@ -304,7 +304,11 @@ def parseRoll(user : str,cmd : str = ""):
rollParameters = [0,0,0,0,0,0,0]
if string.capwords(commands[0]) == "Obligations":
return obligationRoll()
try:
return obligationRoll()
except:
logThis("Obligation fucked up (error code 911)")
return "An error occured (error code 911)"
elif string.capwords(commands[0]) in skillData:
logThis("Oh look! This guy has skills!")
@@ -324,15 +328,15 @@ def parseRoll(user : str,cmd : str = ""):
commands = [str(abilityDice)] + [str(proficiencyDice)] + commands[1:]
logThis("Converted skill to dice")
else:
logThis("Okay, no they don't i guess")
return "You don't have a user. You can make one with !swchar"
logThis("Okay, no they don't i guess (error code 912)")
return "You don't have a user. You can make one with !swchar (error code 912)"
elif string.capwords(commands[0]) in ["Ranged","Piloting"]:
logThis("They fucked up writing the name of a ranged or piloting skill")
if string.capwords(commands[0]) == "Ranged":
return "Did you mean \"Ranged - Heavy\" or \"Ranged - Light\""
return "Did you mean \"Ranged - Heavy\" or \"Ranged - Light\" (error code 913)"
else:
return "Did you mean \"Piloting - Planetary\" or \"Piloting - Space\""
return "Did you mean \"Piloting - Planetary\" or \"Piloting - Space\" (error code 913)"
try:
logThis("Converting commands to dice")
@@ -356,8 +360,8 @@ def parseRoll(user : str,cmd : str = ""):
else:
rollParameters[x] = int(commands[x])
except:
logThis("Someone fucked u-up! (it was them)")
return "Invalid input!"
logThis("Someone fucked u-up! (it was them) (error code 914)")
return "Invalid input! (error code 914)"
logThis("Rolling "+str(rollParameters))
rollResults, diceResults = roll(rollParameters[0],rollParameters[1],rollParameters[2],rollParameters[3],rollParameters[4],rollParameters[5],rollParameters[6])