🔀 removed references to error codes
📝 removed references to error codes
This commit is contained in:
@ -2,7 +2,6 @@ import random
|
||||
import copy
|
||||
import math
|
||||
import discord
|
||||
import math
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
@ -302,7 +301,7 @@ class HexGame():
|
||||
board[row][column] = player
|
||||
return board
|
||||
else:
|
||||
self.bot.log("Cannot place on existing piece (error code 1532)")
|
||||
self.bot.log("Cannot place on existing piece")
|
||||
return None
|
||||
|
||||
# After your move, you have the option to undo get your turn back #TimeTravel
|
||||
@ -608,7 +607,7 @@ class DrawHex():
|
||||
# Save
|
||||
im.save(FILEPATH)
|
||||
except:
|
||||
self.bot.log("Error drawing new hex on board (error code 1541")
|
||||
self.bot.log("Error drawing new hex on board")
|
||||
|
||||
def drawSwap(self, channel):
|
||||
FILEPATH = "gwendolyn/resources/games/hex_boards/board"+channel+".png"
|
||||
@ -640,4 +639,4 @@ class DrawHex():
|
||||
# Save
|
||||
im.save(FILEPATH)
|
||||
except:
|
||||
self.bot.log("Error drawing swap (error code 1542)")
|
||||
self.bot.log("Error drawing swap")
|
||||
|
@ -154,8 +154,8 @@ class LookupFuncs():
|
||||
self.bot.log("Returning spell information")
|
||||
send_message = (f"***{query}***\n*{data[query]['level']} level {data[query]['school']}\nCasting Time: {data[query]['casting_time']}\nRange:{data[query]['range']}\nComponents:{data[query]['components']}\nDuration:{data[query]['duration']}*\n \n{data[query]['description']}")
|
||||
else:
|
||||
self.bot.log("I don't know that spell (error code 501)")
|
||||
send_message = "I don't think that's a spell (error code 501)"
|
||||
self.bot.log("I don't know that spell")
|
||||
send_message = "I don't think that's a spell"
|
||||
|
||||
if len(send_message) > 2000:
|
||||
await ctx.send(send_message[:2000])
|
||||
|
@ -149,7 +149,7 @@ class Other():
|
||||
searchResult = searchResults[0]
|
||||
else:
|
||||
self.bot.log("Couldn't find the page")
|
||||
await ctx.send("Couldn't find page (error code 1002)")
|
||||
await ctx.send("Couldn't find page")
|
||||
else:
|
||||
foundPage = True
|
||||
self.bot.log("Searching for a random page")
|
||||
|
@ -266,8 +266,8 @@ class StarWarsChar():
|
||||
self.bot.log("Returning a list of weapons")
|
||||
return ", ".join(list(userCharacter[key]))
|
||||
else:
|
||||
self.bot.log("The character doesn't have any weapons. Which is probably for the best. Like, who just walks around with weapons? (error code 941)")
|
||||
return "There doesn't seem to be anything there... (error code 941)"
|
||||
self.bot.log("The character doesn't have any weapons. Which is probably for the best. Like, who just walks around with weapons?")
|
||||
return "There doesn't seem to be anything there..."
|
||||
else:
|
||||
return self.setUpDict(userCharacter[key])
|
||||
elif cmd[0] == "+":
|
||||
@ -277,8 +277,8 @@ class StarWarsChar():
|
||||
while cmd[0] == ' ':
|
||||
cmd = cmd[1:]
|
||||
except:
|
||||
self.bot.log("Nope. That didn't happen (error code 942)")
|
||||
return "Can't do that (error code 942)"
|
||||
self.bot.log("Nope. That didn't happen")
|
||||
return "Can't do that"
|
||||
|
||||
if (key == "Talents" or key == "Force-powers") and "," in cmd:
|
||||
cmd = cmd.split(",")
|
||||
@ -298,8 +298,8 @@ class StarWarsChar():
|
||||
self.bot.database["starwars characters"].update_one({"_id":user},
|
||||
{"$set": {key+"."+cmd[0] : int(cmd[1])}})
|
||||
except:
|
||||
self.bot.log("Fucked that up (error code 949)")
|
||||
return "Wrong data type (error code 949)"
|
||||
self.bot.log("Fucked that up")
|
||||
return "Wrong data type"
|
||||
return cmd[0]+" added to "+key+" for " + userCharacter["Name"]
|
||||
|
||||
elif key == "Weapons":
|
||||
@ -313,8 +313,8 @@ class StarWarsChar():
|
||||
return cmd+" added to weapons for " + userCharacter["Name"]
|
||||
|
||||
else:
|
||||
self.bot.log("That's not happening (error code 947d)")
|
||||
return "Can't add that (error code 947d)"
|
||||
self.bot.log("That's not happening")
|
||||
return "Can't add that"
|
||||
|
||||
elif cmd[0] == "-":
|
||||
self.bot.log("Gonna subtract/remove something")
|
||||
@ -323,8 +323,8 @@ class StarWarsChar():
|
||||
while cmd[0] == ' ':
|
||||
cmd = cmd[1:]
|
||||
except:
|
||||
self.bot.log("AAAAAAAAAAAA (error code 948)")
|
||||
return "Can't do that (error code 948)"
|
||||
self.bot.log("AAAAAAAAAAAA ")
|
||||
return "Can't do that "
|
||||
|
||||
if key == "Talents" or key == "Force-powers" or key == "Weapons" or key == "Obligations":
|
||||
self.bot.log("Trying to remove "+cmd+" from "+key)
|
||||
@ -334,11 +334,11 @@ class StarWarsChar():
|
||||
self.bot.log("I did that")
|
||||
return cmd+" removed from "+key+" from "+userCharacter["Name"]
|
||||
else:
|
||||
self.bot.log("Welp. I fucked that up (error code 946e)")
|
||||
return "Can't remove that (error code 946e)"
|
||||
self.bot.log("Welp. I fucked that up")
|
||||
return "Can't remove that"
|
||||
else:
|
||||
self.bot.log("Urgh! (error code 946d)")
|
||||
return "Can't remove that (error code 946d)"
|
||||
self.bot.log("Urgh!")
|
||||
return "Can't remove that"
|
||||
|
||||
else:
|
||||
self.bot.log("Looking up "+cmd+" in "+key)
|
||||
@ -371,8 +371,8 @@ class StarWarsChar():
|
||||
while cmd[0] == ' ':
|
||||
cmd = cmd[1:]
|
||||
except:
|
||||
self.bot.log("Error message (error code 948)")
|
||||
return "Can't do that (error code 948)"
|
||||
self.bot.log("Error message")
|
||||
return "Can't do that"
|
||||
|
||||
if type(userCharacter[key]) is int:
|
||||
try:
|
||||
@ -381,8 +381,8 @@ class StarWarsChar():
|
||||
{"$inc": {key : int(cmd)}})
|
||||
return "Added " + cmd + " to " + userCharacter["Name"] + "'s " + key
|
||||
except:
|
||||
self.bot.log("BITCH SANDWICH (error code 947c)")
|
||||
return "Can't add that (error code 947c)"
|
||||
self.bot.log("BITCH SANDWICH")
|
||||
return "Can't add that"
|
||||
elif type(userCharacter[key]) is list:
|
||||
try:
|
||||
self.bot.log("Adding "+cmd+" to "+key)
|
||||
@ -390,11 +390,11 @@ class StarWarsChar():
|
||||
{"$push": {key : cmd}})
|
||||
return "Added " + cmd + " to " + userCharacter["Name"] + "'s " + key
|
||||
except:
|
||||
self.bot.log("tstststststs (error code 947b)")
|
||||
return "Can't add that (error code 947b)"
|
||||
self.bot.log("tstststststs")
|
||||
return "Can't add that"
|
||||
else:
|
||||
self.bot.log("Help (error code 947a)")
|
||||
return "Can't add that (error code 947a)"
|
||||
self.bot.log("Help")
|
||||
return "Can't add that"
|
||||
elif cmd[0] == '-':
|
||||
self.bot.log("Removing/subtracting")
|
||||
try:
|
||||
@ -402,8 +402,8 @@ class StarWarsChar():
|
||||
while cmd[0] == ' ':
|
||||
cmd = cmd[1:]
|
||||
except:
|
||||
self.bot.log("lalalala (error code 948)")
|
||||
return "Can't do that (error code 948)"
|
||||
self.bot.log("lalalala ")
|
||||
return "Can't do that"
|
||||
|
||||
if type(userCharacter[key]) is int:
|
||||
try:
|
||||
@ -412,8 +412,8 @@ class StarWarsChar():
|
||||
{"$inc": {key : -int(cmd)}})
|
||||
return "Subtracted " + cmd + " from " + userCharacter["Name"] + "'s " + key
|
||||
except:
|
||||
self.bot.log("Tried it. Didn't want to (error code 946c)")
|
||||
return "Can't remove that (error code 946c)"
|
||||
self.bot.log("Tried it. Didn't want to")
|
||||
return "Can't remove that"
|
||||
elif type(userCharacter[key]) is list:
|
||||
try:
|
||||
self.bot.log("removing "+cmd+" from "+key)
|
||||
@ -422,14 +422,14 @@ class StarWarsChar():
|
||||
{"$pull": {key : cmd}})
|
||||
except:
|
||||
self.bot.log("They can only remove stuff that's actually in the list")
|
||||
return "Not in list (error code 944b)"
|
||||
return "Not in list"
|
||||
return "Removed " + cmd + " from " + userCharacter["Name"] + "'s " + key
|
||||
except:
|
||||
self.bot.log("nah (error code 946b)")
|
||||
return "Can't remove that (error code 946b)"
|
||||
self.bot.log("nah")
|
||||
return "Can't remove that"
|
||||
else:
|
||||
self.bot.log("nyope (error code 946a)")
|
||||
return "Can't remove that (error code 946a)"
|
||||
self.bot.log("nyope")
|
||||
return "Can't remove that"
|
||||
else:
|
||||
self.bot.log("Changing "+key+" to "+cmd)
|
||||
if type(userCharacter[key]) is int:
|
||||
@ -437,21 +437,21 @@ class StarWarsChar():
|
||||
self.bot.database["starwars characters"].update_one({"_id":user},
|
||||
{"$set": {key : int(cmd)}})
|
||||
except:
|
||||
self.bot.log("I don't wanna tho (error code 945b)")
|
||||
return "Can't do that (error code 945b)"
|
||||
self.bot.log("I don't wanna tho")
|
||||
return "Can't do that"
|
||||
elif type(userCharacter[key]) is str:
|
||||
self.bot.database["starwars characters"].update_one({"_id":user},
|
||||
{"$set": {key : cmd}})
|
||||
else:
|
||||
self.bot.log("I don't wanna tho (error code 945a)")
|
||||
return "Can't do that (error code 945a)"
|
||||
self.bot.log("I don't wanna tho")
|
||||
return "Can't do that"
|
||||
return "Changed " + userCharacter["Name"] + "'s " + key +" to " + cmd
|
||||
else:
|
||||
self.bot.log(key+" isn't in there (error code 944)")
|
||||
return "Couldn't find that data. Are you sure you spelled it correctly? (error code 944)"
|
||||
self.bot.log(key+" isn't in there")
|
||||
return "Couldn't find that data. Are you sure you spelled it correctly?"
|
||||
else:
|
||||
self.bot.log(user+" doesn't have a character (error code 943)")
|
||||
return "You don't have a character. You can make one with /starwarscharacter (error code 943)"
|
||||
self.bot.log(user+" doesn't have a character")
|
||||
return "You don't have a character. You can make one with /starwarscharacter"
|
||||
|
||||
def replaceSpaces(self,cmd : str):
|
||||
withSpaces = ["Specialization Trees","Wound Threshold","Strain Threshold","Defense - Ranged","Defense - Melee","Force Rating","Core Worlds","Outer Rim","Piloting - Planetary","Piloting - Space","Ranged - Heavy","Ranged - Light","Lightsaber Characteristic","Critical Injuries","Force Powers"]
|
||||
|
@ -59,11 +59,11 @@ class StarWarsDestiny():
|
||||
if len(commands) > 1:
|
||||
send_message = self.destinyNew(int(commands[1]))
|
||||
else:
|
||||
send_message = "You need to give an amount of players (error code 921)"
|
||||
send_message = "You need to give an amount of players"
|
||||
elif commands[0] == "U":
|
||||
send_message = self.destinyUse(user)
|
||||
else:
|
||||
send_message = "I didn't quite understand that (error code 922)"
|
||||
send_message = "I didn't quite understand that"
|
||||
|
||||
message_list = send_message.split("\n")
|
||||
await ctx.send(message_list[0])
|
||||
|
@ -339,9 +339,9 @@ class StarWarsRoll():
|
||||
elif string.capwords(commands[0]) in ["Ranged","Piloting"]:
|
||||
self.bot.log("They fucked up writing the name of a ranged or piloting skill")
|
||||
if string.capwords(commands[0]) == "Ranged":
|
||||
send_message = "Did you mean \"Ranged - Heavy\" or \"Ranged - Light\" (error code 913)"
|
||||
send_message = "Did you mean \"Ranged - Heavy\" or \"Ranged - Light\""
|
||||
else:
|
||||
send_message = "Did you mean \"Piloting - Planetary\" or \"Piloting - Space\" (error code 913)"
|
||||
send_message = "Did you mean \"Piloting - Planetary\" or \"Piloting - Space\""
|
||||
else:
|
||||
validCommand = True
|
||||
|
||||
|
@ -145,7 +145,7 @@ class ErrorHandler():
|
||||
if isinstance(error, discord.errors.NotFound):
|
||||
self.bot.log("Context is non-existant", level=40)
|
||||
else:
|
||||
await ctx.send("Something went wrong (error code 000)")
|
||||
await ctx.send("Something went wrong")
|
||||
|
||||
async def on_error(self, method: str):
|
||||
"""Log when there's an error."""
|
||||
|
Reference in New Issue
Block a user