aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/evergreen/minesweeper.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/seasons/evergreen/minesweeper.py')
-rw-r--r--bot/seasons/evergreen/minesweeper.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/bot/seasons/evergreen/minesweeper.py b/bot/seasons/evergreen/minesweeper.py
index 3eee92ca..015b09df 100644
--- a/bot/seasons/evergreen/minesweeper.py
+++ b/bot/seasons/evergreen/minesweeper.py
@@ -32,8 +32,8 @@ log = logging.getLogger(__name__)
class CoordinateConverter(commands.Converter):
"""Converter for Coordinates."""
- async def convert(self, ctx, coordinate: str) -> typing.Tuple[int, int]:
- """Take in a coordinate string and turn it into an (x, y) tuple."""
+ async def convert(self, ctx: commands.Context, coordinate: str) -> typing.Tuple[int, int]:
+ """Take in a coordinate string and turn it into x, y"""
if not 2 <= len(coordinate) <= 3:
raise commands.BadArgument('Invalid co-ordinate provided')
@@ -80,8 +80,8 @@ class Minesweeper(commands.Cog):
self.games: GamesDict = {} # Store the currently running games
@commands.group(name='minesweeper', aliases=('ms',), invoke_without_command=True)
- async def minesweeper_group(self, ctx: commands.Context):
- """Commands for Playing Minesweeper."""
+ async def minesweeper_group(self, ctx: commands.Context) -> None:
+ """Commands for Playing Minesweeper"""
await ctx.send_help(ctx.command)
@staticmethod
@@ -215,8 +215,8 @@ class Minesweeper(commands.Cog):
if board[y_][x_] == 0:
self.reveal_zeros(revealed, board, x_, y_)
- async def check_if_won(self, ctx, revealed: GameBoard, board: GameBoard) -> bool:
- """Checks if a player has won."""
+ async def check_if_won(self, ctx: commands.Context, revealed: GameBoard, board: GameBoard) -> bool:
+ """Checks if a player has won"""
if any(
revealed[y][x] in ["hidden", "flag"] and board[y][x] != "bomb"
for x in range(10)
@@ -267,8 +267,8 @@ class Minesweeper(commands.Cog):
await self.update_boards(ctx)
@minesweeper_group.command(name="end")
- async def end_command(self, ctx: commands.Context):
- """End your current game."""
+ async def end_command(self, ctx: commands.Context) -> None:
+ """End your current game"""
game = self.games[ctx.author.id]
game.revealed = game.board
await self.update_boards(ctx)