🔴 Converted all of connectFour to slash commands

This commit is contained in:
NikolajDanger
2021-04-03 23:16:17 +02:00
parent 1a2ead8448
commit b34a126ed1
6 changed files with 229 additions and 169 deletions

View File

@ -78,27 +78,21 @@ class ConnectFourCog(commands.Cog):
def __init__(self,bot):
"""Runs game stuff."""
self.bot = bot
# Start a game of connect four against a user
@cog_ext.cog_subcommand(**params["connectFourStartUser"])
async def connectFourStartUser(self, ctx, user):
await ctx.defer()
await self.bot.games.gameLoops.connectFour(ctx, "start "+user.display_name)
await self.bot.games.connectFour.start(ctx, user)
# Start a game of connect four against gwendolyn
@cog_ext.cog_subcommand(**params["connectFourStartGwendolyn"])
async def connectFourStartGwendolyn(self, ctx, difficulty = 3):
await ctx.defer()
await self.bot.games.gameLoops.connectFour(ctx, "start "+str(difficulty))
await self.bot.games.connectFour.start(ctx, difficulty)
# Stop the current game of connect four
@cog_ext.cog_subcommand(**params["connectFourStop"])
async def connectFourStop(self, ctx):
await self.bot.games.gameLoops.connectFour(ctx, "stop")
# Place a piece in the current game of connect four
@cog_ext.cog_subcommand(**params["connectFourPlace"])
async def connectFourPlace(self, ctx, column):
await self.bot.games.gameLoops.connectFour(ctx, "place "+str(column))
@cog_ext.cog_subcommand(**params["connectFourSurrender"])
async def connectFourSurrender(self, ctx):
await self.bot.games.connectFour.surrender(ctx)
class HangmanCog(commands.Cog):