aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-06 18:53:48 +0300
committerGravatar ks129 <[email protected]>2020-04-06 18:53:48 +0300
commit945e6750372d7f8ce34319c570aa3786fbde4bcf (patch)
tree3f79e302806b2752d97978d7732fa85005749451 /bot
parentMerge pull request #392 from python-discord/fetch-devlog-channel (diff)
(Minesweeper): Added try-except block to reveal command.
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/evergreen/minesweeper.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/exts/evergreen/minesweeper.py b/bot/exts/evergreen/minesweeper.py
index b59cdb14..2626b1c4 100644
--- a/bot/exts/evergreen/minesweeper.py
+++ b/bot/exts/evergreen/minesweeper.py
@@ -253,7 +253,11 @@ class Minesweeper(commands.Cog):
@minesweeper_group.command(name="reveal")
async def reveal_command(self, ctx: commands.Context, *coordinates: CoordinateConverter) -> None:
"""Reveal multiple cells."""
- game = self.games[ctx.author.id]
+ try:
+ game = self.games[ctx.author.id]
+ except KeyError:
+ await ctx.author.send("Game don't exist. Can't reveal.")
+ return
revealed: GameBoard = game.revealed
board: GameBoard = game.board