🥅 More error codes
This commit is contained in:
20
Gwendolyn.py
20
Gwendolyn.py
@ -23,17 +23,26 @@ meanWords = ["stupid", "bitch", "fuck", "dumb", "idiot"]
|
|||||||
|
|
||||||
# Runs Four in a Row
|
# Runs Four in a Row
|
||||||
async def fiar(channel,command,user):
|
async def fiar(channel,command,user):
|
||||||
|
try:
|
||||||
response, showImage, deleteImage, gameDone, gwendoTurn = parseFourInARow(command,str(channel),user)
|
response, showImage, deleteImage, gameDone, gwendoTurn = parseFourInARow(command,str(channel),user)
|
||||||
|
except:
|
||||||
|
logThis("Error parsing command (error code 1410)")
|
||||||
|
|
||||||
await channel.send(response)
|
await channel.send(response)
|
||||||
logThis(response,str(channel))
|
logThis(response,str(channel))
|
||||||
if showImage:
|
if showImage:
|
||||||
if deleteImage:
|
if deleteImage:
|
||||||
|
try:
|
||||||
oldImage = await deleteMessage("fourInARow"+str(channel),channel)
|
oldImage = await deleteMessage("fourInARow"+str(channel),channel)
|
||||||
|
except:
|
||||||
|
logThis("Error deleting message (error code 1401)")
|
||||||
oldImage = await channel.send(file = discord.File("resources/games/4InARowBoards/board"+str(channel)+".png"))
|
oldImage = await channel.send(file = discord.File("resources/games/4InARowBoards/board"+str(channel)+".png"))
|
||||||
if gameDone == False:
|
if gameDone == False:
|
||||||
if gwendoTurn:
|
if gwendoTurn:
|
||||||
await asyncio.sleep(1)
|
try:
|
||||||
response, showImage, deleteImage, gameDone, gwendoTurn = fourInARowAI(str(channel))
|
response, showImage, deleteImage, gameDone, gwendoTurn = fourInARowAI(str(channel))
|
||||||
|
except:
|
||||||
|
logThis("AI error (error code 1420)")
|
||||||
await channel.send(response)
|
await channel.send(response)
|
||||||
logThis(response,str(channel))
|
logThis(response,str(channel))
|
||||||
if showImage:
|
if showImage:
|
||||||
@ -501,6 +510,7 @@ async def parseCommands(message,content):
|
|||||||
|
|
||||||
# Runs a game of Blackjack
|
# Runs a game of Blackjack
|
||||||
elif content.startswith("blackjack"):
|
elif content.startswith("blackjack"):
|
||||||
|
try:
|
||||||
# Starts the game
|
# Starts the game
|
||||||
if content == "blackjack" or content == "blackjack ":
|
if content == "blackjack" or content == "blackjack ":
|
||||||
cardsLeft = 0
|
cardsLeft = 0
|
||||||
@ -676,12 +686,18 @@ async def parseCommands(message,content):
|
|||||||
await message.channel.send(str(cardsLeft)+" cards, "+str(decksLeft)+" decks")
|
await message.channel.send(str(cardsLeft)+" cards, "+str(decksLeft)+" decks")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await message.channel.send("I didn't quite understand that")
|
logThis("Not a command (error code 1301)")
|
||||||
|
await message.channel.send("I didn't quite understand that (error code 1301)")
|
||||||
|
except:
|
||||||
|
logThis("Something went wrong (error code 1300)")
|
||||||
|
|
||||||
# Runs a game of four in a row
|
# Runs a game of four in a row
|
||||||
elif content.startswith("fourinarow"):
|
elif content.startswith("fourinarow"):
|
||||||
|
try:
|
||||||
command = content.replace("fourinarow","")
|
command = content.replace("fourinarow","")
|
||||||
await fiar(message.channel,command,message.author.display_name)
|
await fiar(message.channel,command,message.author.display_name)
|
||||||
|
except:
|
||||||
|
logThis("Something went wrong (error code 1400)")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,4 +87,7 @@
|
|||||||
1300 - Unspecified
|
1300 - Unspecified
|
||||||
|
|
||||||
14 - Four in a row
|
14 - Four in a row
|
||||||
600 - Unspecified
|
1400 - Unspecified
|
||||||
|
1401 - Error deleting old image
|
||||||
|
1410 - Unspecified parsing error
|
||||||
|
1420 - Unspecified AI error
|
Reference in New Issue
Block a user