1
0
Fork 0
mirror of synced 2024-06-10 14:44:32 +12:00

Added a fail check to ensure only one game is setup per server

This commit is contained in:
Phxntxm 2016-08-14 18:10:31 -05:00
parent f9cd43b516
commit fede75f634

View file

@ -232,6 +232,9 @@ class TicTacToe:
async def start_game(self, ctx, player2: discord.Member):
"""Starts a game of tictactoe with another player"""
player1 = ctx.message.author
if self.boards.get(ctx.message.server.id) != None:
await self.bot.say("Sorry but only one Tic-Tac-Toe game can be running per server!")
return
x_player = self.create(ctx.message.server.id, player1, player2)
fmt = "A tictactoe game has just started between {} and {}".format(player1.display_name, player2.display_name)
fmt += str(self.boards[ctx.message.server.id])