aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/evergreen/tic_tac_toe.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/evergreen/tic_tac_toe.py b/bot/exts/evergreen/tic_tac_toe.py
index 55bbb7be..01417f25 100644
--- a/bot/exts/evergreen/tic_tac_toe.py
+++ b/bot/exts/evergreen/tic_tac_toe.py
@@ -121,6 +121,11 @@ class TicTacToe(Cog):
@command(name="tictactoe", aliases=("ttt",))
async def tic_tac_toe(self, ctx: Context, opponent: discord.User) -> None:
"""Tic Tac Toe game. Play agains friends. Use reactions to add your mark to field."""
+ if not all(
+ opponent not in (player.user for player in g.players) for g in ctx.cog.games if not g.over
+ ):
+ await ctx.send("Opponent is already in game.")
+ return
game = Game(
ctx.channel,
[Player(ctx.author, ctx), Player(opponent, ctx)],