1
0
Fork 0
mirror of synced 2024-06-27 18:50:35 +12:00

Added a force stop command

This commit is contained in:
Phxntxm 2016-08-21 15:23:47 -05:00
parent bf535f3cbc
commit b6a2f491ef
2 changed files with 26 additions and 0 deletions

View file

@ -159,6 +159,19 @@ class Hangman:
await self.bot.say(
"Alright, a hangman game has just started, you can start guessing now!\n{}".format(str(game)))
@hangman.command(name='delete', aliases=['stop', 'remove'], pass_context=True, no_pm=True)
@checks.custom_perms(kick_members=True)
async def stop_game(self, ctx):
"""Force stops a game of hangman
This should realistically only be used in a situation like one player leaves
Hopefully a moderator will not abuse it, but there's not much we can do to avoid that"""
if self.games.get(ctx.message.server.id) is None:
await self.bot.say("There are no Hangman games running on this server!")
return
del self.games[ctx.message.server.id]
await self.bot.say("I have just stopped the game of Hangman, a new should be able to be started now!")
def setup(bot):
bot.add_cog(Hangman(bot))

View file

@ -265,6 +265,19 @@ class TicTacToe:
x_player.display_name)
await self.bot.say(fmt)
@tictactoe.command(name='delete', aliases=['stop', 'remove'], pass_context=True, no_pm=True)
@checks.custom_perms(kick_members=True)
async def stop_game(self, ctx):
"""Force stops a game of tictactoe
This should realistically only be used in a situation like one player leaves
Hopefully a moderator will not abuse it, but there's not much we can do to avoid that"""
if self.boards.get(ctx.message.server.id) is None:
await self.bot.say("There are no tictactoe games running on this server!")
return
del self.boards[ctx.message.server.id]
await self.bot.say("I have just stopped the game of TicTacToe, a new should be able to be started now!")
def setup(bot):
bot.add_cog(TicTacToe(bot))