aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/fun/minesweeper.py
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-09-23 22:58:49 +0100
committerGravatar GitHub <[email protected]>2022-09-23 22:58:49 +0100
commitf9cc77f55a7bac9cff1f5674b36b3f17560f6bfe (patch)
tree4d9a9684d6c0d8f1f749355353fbadb7fd89960b /bot/exts/fun/minesweeper.py
parentFix issue #1050 (#1097) (diff)
parentRemove all wait_until_guil_available as this is now done in bot-core (diff)
Merge pull request #1092 from python-discord/bot-core-migration
Diffstat (limited to 'bot/exts/fun/minesweeper.py')
-rw-r--r--bot/exts/fun/minesweeper.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/exts/fun/minesweeper.py b/bot/exts/fun/minesweeper.py
index a48b5051..f16b1db2 100644
--- a/bot/exts/fun/minesweeper.py
+++ b/bot/exts/fun/minesweeper.py
@@ -11,7 +11,6 @@ from bot.bot import Bot
from bot.constants import Client
from bot.utils.converters import CoordinateConverter
from bot.utils.exceptions import UserNotPlayingError
-from bot.utils.extensions import invoke_help_command
MESSAGE_MAPPING = {
0: ":stop_button:",
@@ -51,13 +50,14 @@ class Game:
class Minesweeper(commands.Cog):
"""Play a game of Minesweeper."""
- def __init__(self):
+ def __init__(self, bot: Bot):
+ self.bot = bot
self.games: dict[int, Game] = {}
@commands.group(name="minesweeper", aliases=("ms",), invoke_without_command=True)
async def minesweeper_group(self, ctx: commands.Context) -> None:
"""Commands for Playing Minesweeper."""
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
@staticmethod
def get_neighbours(x: int, y: int) -> Iterator[tuple[int, int]]:
@@ -265,6 +265,6 @@ class Minesweeper(commands.Cog):
del self.games[ctx.author.id]
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Minesweeper cog."""
- bot.add_cog(Minesweeper())
+ await bot.add_cog(Minesweeper(bot))