1
0
Fork 0
mirror of synced 2024-06-21 12:00:16 +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

@ -158,6 +158,19 @@ class Hangman:
# Let them know the game has started, then print the current game so that the blanks are shown
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):

View file

@ -264,6 +264,19 @@ class TicTacToe:
fmt += "I have decided at random, and {} is going to be x's this game. It is your turn first!".format(
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):