diff options
| author | 2020-04-13 08:19:10 +0300 | |
|---|---|---|
| committer | 2020-04-13 08:19:10 +0300 | |
| commit | 494cb28681f2de44ff4f95b1b9fe4b1662239cb6 (patch) | |
| tree | e1c3f85efe181a87239d0341a131cdaadb2eb75b /bot | |
| parent | (TicTacToe): Created new helper functions `display` to `Player` and `AI` clas... (diff) | |
(TicTacToe): Applied `Player.display()` and `AI.display()` to cog and `Game` class.
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/exts/evergreen/tic_tac_toe.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/bot/exts/evergreen/tic_tac_toe.py b/bot/exts/evergreen/tic_tac_toe.py index 8d0c384b..435c7af3 100644 --- a/bot/exts/evergreen/tic_tac_toe.py +++ b/bot/exts/evergreen/tic_tac_toe.py @@ -237,8 +237,7 @@ class Game: self.winner = self.current self.loser = self.next await self.ctx.send( - f":tada: {self.current.user.mention if isinstance(self.current, Player) else 'AI'} " - f"is won this game! :tada:" + f":tada: {self.current.display()} is won this game! :tada:" ) await board.clear_reactions() break @@ -317,13 +316,11 @@ class TicTacToe(Cog): if game.over and not game.canceled: if game.draw: log_games.append( - f"**#{i+1}**: {game.players[0].user.mention} vs " - f"{game.players[1].user.mention if isinstance(game.players[1], Player) else 'AI'} (draw)" + f"**#{i+1}**: {game.players[0].display()} vs {game.players[1].display()} (draw)" ) else: log_games.append( - f"**#{i+1}**: {game.winner.user.mention if isinstance(game.winner, Player) else 'AI'} :trophy: " - f"vs {game.loser.user.mention if isinstance(game.loser, Player) else 'AI'}" + f"**#{i+1}**: {game.winner.display()} :trophy: vs {game.loser.display()}" ) await LinePaginator.paginate( log_games, @@ -339,8 +336,7 @@ class TicTacToe(Cog): return game = self.games[game_id - 1] await ctx.send( - f"{game.winner.user if isinstance(game.winner, Player) else 'AI'} " - f":trophy: vs {game.loser.user if isinstance(game.winner, Player) else 'AI'}" + f"{game.winner.display()} :trophy: vs {game.loser.display()}" ) await game.send_board(ctx.channel) |