aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/tic_tac_toe.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-09 19:28:44 +0300
committerGravatar ks129 <[email protected]>2020-04-09 19:28:44 +0300
commit2d22d7b791416adea1052175da386a196d19d1a8 (patch)
tree39564b67babe0b88ea85d993e16cfcc9a91fef02 /bot/exts/evergreen/tic_tac_toe.py
parent(TicTacToe): Added new variable to `Game` class: `canceled`, applied it's cha... (diff)
(TicTacToe): Added way to send board to custom channel in `Game.send_board`.
Diffstat (limited to 'bot/exts/evergreen/tic_tac_toe.py')
-rw-r--r--bot/exts/evergreen/tic_tac_toe.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/evergreen/tic_tac_toe.py b/bot/exts/evergreen/tic_tac_toe.py
index c1f780cf..87a845f1 100644
--- a/bot/exts/evergreen/tic_tac_toe.py
+++ b/bot/exts/evergreen/tic_tac_toe.py
@@ -113,7 +113,7 @@ class Game:
for nr in Emojis.number_emojis.values():
await msg.add_reaction(nr)
- async def send_board(self) -> discord.Message:
+ async def send_board(self, channel: t.Optional[discord.TextChannel] = None) -> discord.Message:
"""Send board and return it's message."""
msg = ""
c = 0
@@ -123,6 +123,8 @@ class Game:
if c == 3:
msg += "\n"
c = 0
+ if channel:
+ return await channel.send(msg)
return await self.ctx.send(msg)
async def edit_board(self, message: discord.Message) -> None: