📝 removed references to error codes

This commit is contained in:
NikolajDanger
2021-08-20 16:39:44 +02:00
parent f4c485dfe0
commit c7a0c773dc
7 changed files with 50 additions and 51 deletions

View File

@ -2,7 +2,6 @@ import random
import copy import copy
import math import math
import discord import discord
import math
from PIL import Image, ImageDraw, ImageFont from PIL import Image, ImageDraw, ImageFont
@ -302,7 +301,7 @@ class HexGame():
board[row][column] = player board[row][column] = player
return board return board
else: else:
self.bot.log("Cannot place on existing piece (error code 1532)") self.bot.log("Cannot place on existing piece")
return None return None
# After your move, you have the option to undo get your turn back #TimeTravel # After your move, you have the option to undo get your turn back #TimeTravel
@ -608,7 +607,7 @@ class DrawHex():
# Save # Save
im.save(FILEPATH) im.save(FILEPATH)
except: 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): def drawSwap(self, channel):
FILEPATH = "gwendolyn/resources/games/hex_boards/board"+channel+".png" FILEPATH = "gwendolyn/resources/games/hex_boards/board"+channel+".png"
@ -640,4 +639,4 @@ class DrawHex():
# Save # Save
im.save(FILEPATH) im.save(FILEPATH)
except: except:
self.bot.log("Error drawing swap (error code 1542)") self.bot.log("Error drawing swap")

View File

@ -154,8 +154,8 @@ class LookupFuncs():
self.bot.log("Returning spell information") 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']}") 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: else:
self.bot.log("I don't know that spell (error code 501)") self.bot.log("I don't know that spell")
send_message = "I don't think that's a spell (error code 501)" send_message = "I don't think that's a spell"
if len(send_message) > 2000: if len(send_message) > 2000:
await ctx.send(send_message[:2000]) await ctx.send(send_message[:2000])

View File

@ -149,7 +149,7 @@ class Other():
searchResult = searchResults[0] searchResult = searchResults[0]
else: else:
self.bot.log("Couldn't find the page") 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: else:
foundPage = True foundPage = True
self.bot.log("Searching for a random page") self.bot.log("Searching for a random page")

View File

@ -266,8 +266,8 @@ class StarWarsChar():
self.bot.log("Returning a list of weapons") self.bot.log("Returning a list of weapons")
return ", ".join(list(userCharacter[key])) return ", ".join(list(userCharacter[key]))
else: 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)") 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... (error code 941)" return "There doesn't seem to be anything there..."
else: else:
return self.setUpDict(userCharacter[key]) return self.setUpDict(userCharacter[key])
elif cmd[0] == "+": elif cmd[0] == "+":
@ -277,8 +277,8 @@ class StarWarsChar():
while cmd[0] == ' ': while cmd[0] == ' ':
cmd = cmd[1:] cmd = cmd[1:]
except: except:
self.bot.log("Nope. That didn't happen (error code 942)") self.bot.log("Nope. That didn't happen")
return "Can't do that (error code 942)" return "Can't do that"
if (key == "Talents" or key == "Force-powers") and "," in cmd: if (key == "Talents" or key == "Force-powers") and "," in cmd:
cmd = cmd.split(",") cmd = cmd.split(",")
@ -298,8 +298,8 @@ class StarWarsChar():
self.bot.database["starwars characters"].update_one({"_id":user}, self.bot.database["starwars characters"].update_one({"_id":user},
{"$set": {key+"."+cmd[0] : int(cmd[1])}}) {"$set": {key+"."+cmd[0] : int(cmd[1])}})
except: except:
self.bot.log("Fucked that up (error code 949)") self.bot.log("Fucked that up")
return "Wrong data type (error code 949)" return "Wrong data type"
return cmd[0]+" added to "+key+" for " + userCharacter["Name"] return cmd[0]+" added to "+key+" for " + userCharacter["Name"]
elif key == "Weapons": elif key == "Weapons":
@ -313,8 +313,8 @@ class StarWarsChar():
return cmd+" added to weapons for " + userCharacter["Name"] return cmd+" added to weapons for " + userCharacter["Name"]
else: else:
self.bot.log("That's not happening (error code 947d)") self.bot.log("That's not happening")
return "Can't add that (error code 947d)" return "Can't add that"
elif cmd[0] == "-": elif cmd[0] == "-":
self.bot.log("Gonna subtract/remove something") self.bot.log("Gonna subtract/remove something")
@ -323,8 +323,8 @@ class StarWarsChar():
while cmd[0] == ' ': while cmd[0] == ' ':
cmd = cmd[1:] cmd = cmd[1:]
except: except:
self.bot.log("AAAAAAAAAAAA (error code 948)") self.bot.log("AAAAAAAAAAAA ")
return "Can't do that (error code 948)" return "Can't do that "
if key == "Talents" or key == "Force-powers" or key == "Weapons" or key == "Obligations": if key == "Talents" or key == "Force-powers" or key == "Weapons" or key == "Obligations":
self.bot.log("Trying to remove "+cmd+" from "+key) self.bot.log("Trying to remove "+cmd+" from "+key)
@ -334,11 +334,11 @@ class StarWarsChar():
self.bot.log("I did that") self.bot.log("I did that")
return cmd+" removed from "+key+" from "+userCharacter["Name"] return cmd+" removed from "+key+" from "+userCharacter["Name"]
else: else:
self.bot.log("Welp. I fucked that up (error code 946e)") self.bot.log("Welp. I fucked that up")
return "Can't remove that (error code 946e)" return "Can't remove that"
else: else:
self.bot.log("Urgh! (error code 946d)") self.bot.log("Urgh!")
return "Can't remove that (error code 946d)" return "Can't remove that"
else: else:
self.bot.log("Looking up "+cmd+" in "+key) self.bot.log("Looking up "+cmd+" in "+key)
@ -371,8 +371,8 @@ class StarWarsChar():
while cmd[0] == ' ': while cmd[0] == ' ':
cmd = cmd[1:] cmd = cmd[1:]
except: except:
self.bot.log("Error message (error code 948)") self.bot.log("Error message")
return "Can't do that (error code 948)" return "Can't do that"
if type(userCharacter[key]) is int: if type(userCharacter[key]) is int:
try: try:
@ -381,8 +381,8 @@ class StarWarsChar():
{"$inc": {key : int(cmd)}}) {"$inc": {key : int(cmd)}})
return "Added " + cmd + " to " + userCharacter["Name"] + "'s " + key return "Added " + cmd + " to " + userCharacter["Name"] + "'s " + key
except: except:
self.bot.log("BITCH SANDWICH (error code 947c)") self.bot.log("BITCH SANDWICH")
return "Can't add that (error code 947c)" return "Can't add that"
elif type(userCharacter[key]) is list: elif type(userCharacter[key]) is list:
try: try:
self.bot.log("Adding "+cmd+" to "+key) self.bot.log("Adding "+cmd+" to "+key)
@ -390,11 +390,11 @@ class StarWarsChar():
{"$push": {key : cmd}}) {"$push": {key : cmd}})
return "Added " + cmd + " to " + userCharacter["Name"] + "'s " + key return "Added " + cmd + " to " + userCharacter["Name"] + "'s " + key
except: except:
self.bot.log("tstststststs (error code 947b)") self.bot.log("tstststststs")
return "Can't add that (error code 947b)" return "Can't add that"
else: else:
self.bot.log("Help (error code 947a)") self.bot.log("Help")
return "Can't add that (error code 947a)" return "Can't add that"
elif cmd[0] == '-': elif cmd[0] == '-':
self.bot.log("Removing/subtracting") self.bot.log("Removing/subtracting")
try: try:
@ -402,8 +402,8 @@ class StarWarsChar():
while cmd[0] == ' ': while cmd[0] == ' ':
cmd = cmd[1:] cmd = cmd[1:]
except: except:
self.bot.log("lalalala (error code 948)") self.bot.log("lalalala ")
return "Can't do that (error code 948)" return "Can't do that"
if type(userCharacter[key]) is int: if type(userCharacter[key]) is int:
try: try:
@ -412,8 +412,8 @@ class StarWarsChar():
{"$inc": {key : -int(cmd)}}) {"$inc": {key : -int(cmd)}})
return "Subtracted " + cmd + " from " + userCharacter["Name"] + "'s " + key return "Subtracted " + cmd + " from " + userCharacter["Name"] + "'s " + key
except: except:
self.bot.log("Tried it. Didn't want to (error code 946c)") self.bot.log("Tried it. Didn't want to")
return "Can't remove that (error code 946c)" return "Can't remove that"
elif type(userCharacter[key]) is list: elif type(userCharacter[key]) is list:
try: try:
self.bot.log("removing "+cmd+" from "+key) self.bot.log("removing "+cmd+" from "+key)
@ -422,14 +422,14 @@ class StarWarsChar():
{"$pull": {key : cmd}}) {"$pull": {key : cmd}})
except: except:
self.bot.log("They can only remove stuff that's actually in the list") 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 return "Removed " + cmd + " from " + userCharacter["Name"] + "'s " + key
except: except:
self.bot.log("nah (error code 946b)") self.bot.log("nah")
return "Can't remove that (error code 946b)" return "Can't remove that"
else: else:
self.bot.log("nyope (error code 946a)") self.bot.log("nyope")
return "Can't remove that (error code 946a)" return "Can't remove that"
else: else:
self.bot.log("Changing "+key+" to "+cmd) self.bot.log("Changing "+key+" to "+cmd)
if type(userCharacter[key]) is int: if type(userCharacter[key]) is int:
@ -437,21 +437,21 @@ class StarWarsChar():
self.bot.database["starwars characters"].update_one({"_id":user}, self.bot.database["starwars characters"].update_one({"_id":user},
{"$set": {key : int(cmd)}}) {"$set": {key : int(cmd)}})
except: except:
self.bot.log("I don't wanna tho (error code 945b)") self.bot.log("I don't wanna tho")
return "Can't do that (error code 945b)" return "Can't do that"
elif type(userCharacter[key]) is str: elif type(userCharacter[key]) is str:
self.bot.database["starwars characters"].update_one({"_id":user}, self.bot.database["starwars characters"].update_one({"_id":user},
{"$set": {key : cmd}}) {"$set": {key : cmd}})
else: else:
self.bot.log("I don't wanna tho (error code 945a)") self.bot.log("I don't wanna tho")
return "Can't do that (error code 945a)" return "Can't do that"
return "Changed " + userCharacter["Name"] + "'s " + key +" to " + cmd return "Changed " + userCharacter["Name"] + "'s " + key +" to " + cmd
else: else:
self.bot.log(key+" isn't in there (error code 944)") self.bot.log(key+" isn't in there")
return "Couldn't find that data. Are you sure you spelled it correctly? (error code 944)" return "Couldn't find that data. Are you sure you spelled it correctly?"
else: else:
self.bot.log(user+" doesn't have a character (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 (error code 943)" return "You don't have a character. You can make one with /starwarscharacter"
def replaceSpaces(self,cmd : str): 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"] 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"]

View File

@ -59,11 +59,11 @@ class StarWarsDestiny():
if len(commands) > 1: if len(commands) > 1:
send_message = self.destinyNew(int(commands[1])) send_message = self.destinyNew(int(commands[1]))
else: 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": elif commands[0] == "U":
send_message = self.destinyUse(user) send_message = self.destinyUse(user)
else: 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") message_list = send_message.split("\n")
await ctx.send(message_list[0]) await ctx.send(message_list[0])

View File

@ -339,9 +339,9 @@ class StarWarsRoll():
elif string.capwords(commands[0]) in ["Ranged","Piloting"]: elif string.capwords(commands[0]) in ["Ranged","Piloting"]:
self.bot.log("They fucked up writing the name of a ranged or piloting skill") self.bot.log("They fucked up writing the name of a ranged or piloting skill")
if string.capwords(commands[0]) == "Ranged": 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: 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: else:
validCommand = True validCommand = True

View File

@ -145,7 +145,7 @@ class ErrorHandler():
if isinstance(error, discord.errors.NotFound): if isinstance(error, discord.errors.NotFound):
self.bot.log("Context is non-existant", level=40) self.bot.log("Context is non-existant", level=40)
else: else:
await ctx.send("Something went wrong (error code 000)") await ctx.send("Something went wrong")
async def on_error(self, method: str): async def on_error(self, method: str):
"""Log when there's an error.""" """Log when there's an error."""