diff options
author | 2020-04-09 19:14:25 +0300 | |
---|---|---|
committer | 2020-04-09 19:14:25 +0300 | |
commit | b15c637568f33b2600e822a5aff54a90ea02f91f (patch) | |
tree | 61f0f7437326ca21aaf74249288f70348860769a | |
parent | (TicTacToe): Removed unnecessary variable `channel` from `Game`. (diff) |
(TicTacToe): Added check that don't allow you to play against yourself to `tictactoe` command.
-rw-r--r-- | bot/exts/evergreen/tic_tac_toe.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/exts/evergreen/tic_tac_toe.py b/bot/exts/evergreen/tic_tac_toe.py index e8aafa07..f1e0834b 100644 --- a/bot/exts/evergreen/tic_tac_toe.py +++ b/bot/exts/evergreen/tic_tac_toe.py @@ -206,6 +206,9 @@ 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 opponent == ctx.author: + await ctx.send("You can't play against yourself.") + return if not all( opponent not in (player.user for player in g.players) for g in ctx.cog.games if not g.over ): |