🐛 You can now challenge other players to connect four

This commit is contained in:
NikolajDanger
2021-04-04 18:23:08 +02:00
parent 5647cea552
commit aea2875957

View File

@ -53,16 +53,28 @@ class ConnectFour():
logMessage = "They tried to play against a difficulty that doesn't exist"
canStart = False
elif type(opponent) == discord.user:
# Opponent is another player
if ctx.author != opponent:
opponent = f"#{opponent.id}"
difficulty = 5
diffText = ""
elif type(opponent) == discord.member.Member:
if opponent.bot:
# User has challenged a bot
if opponent == self.bot.user:
# It was Gwendolyn
difficulty = 3
diffText = f" with difficulty {difficulty}"
opponent = f"#{self.bot.user.id}"
else:
sendMessage = "You can't challenge a bot!"
logMessage = "They tried to challenge a bot"
canStart = False
else:
sendMessage = "You can't play against yourself"
logMessage = "They tried to play against themself"
canStart = False
# Opponent is another player
if ctx.author != opponent:
opponent = f"#{opponent.id}"
difficulty = 5
diffText = ""
else:
sendMessage = "You can't play against yourself"
logMessage = "They tried to play against themself"
canStart = False
if canStart:
board = [[0 for _ in range(COLUMNCOUNT)] for _ in range(ROWCOUNT)]