Allow admins to use !fgame without joining
This commit is contained in:
parent
85a342f9c5
commit
1a80bc1027
@ -3380,33 +3380,40 @@ if botconfig.DEBUG_MODE or botconfig.ALLOWED_NORMAL_MODE_COMMANDS:
|
|||||||
|
|
||||||
|
|
||||||
@cmd("fgame", admin_only=True)
|
@cmd("fgame", admin_only=True)
|
||||||
def game(cli, nick, chan, rest):
|
def fgame(cli, nick, chan, rest):
|
||||||
pl = var.list_players()
|
pl = var.list_players()
|
||||||
if var.PHASE == "none":
|
|
||||||
cli.notice(nick, "No game is currently running.")
|
if var.PHASE == 'none':
|
||||||
|
cli.notice(nick, 'No game is currently running.')
|
||||||
return
|
return
|
||||||
if var.PHASE != "join":
|
|
||||||
cli.notice(nick, "Werewolf is already in play.")
|
if var.PHASE != 'join':
|
||||||
|
cli.notice(nick, 'Werewolf is already in play.')
|
||||||
return
|
return
|
||||||
if nick not in pl:
|
|
||||||
cli.notice(nick, "You're currently not playing.")
|
if nick not in pl and nick not in botconfig.ADMINS + botconfig.OWNERS:
|
||||||
|
cli.notice(nick, 'You\'re currently not playing.')
|
||||||
return
|
return
|
||||||
|
|
||||||
rest = rest.strip().lower()
|
rest = rest.strip().lower()
|
||||||
|
|
||||||
if rest:
|
if rest:
|
||||||
if cgamemode(cli, *re.split(" +",rest)):
|
if cgamemode(cli, *re.split(' +', rest)):
|
||||||
cli.msg(chan, ("\u0002{0}\u0002 has changed the "+
|
cli.msg(chan, ('\u0002{}\u0002 has changed the game settings '
|
||||||
"game settings successfully.").format(nick))
|
'successfully.').format(nick))
|
||||||
|
|
||||||
def fgame_help(args = ""):
|
def fgame_help(args=''):
|
||||||
args = args.strip()
|
args = args.strip()
|
||||||
|
|
||||||
if not args:
|
if not args:
|
||||||
return "Available game mode setters: "+ ", ".join(var.GAME_MODES.keys())
|
return 'Available game mode setters: ' + ', '.join(var.GAME_MODES.keys())
|
||||||
elif args in var.GAME_MODES.keys():
|
elif args in var.GAME_MODES.keys():
|
||||||
return var.GAME_MODES[args].__doc__
|
return var.GAME_MODES[args].__doc__
|
||||||
else:
|
else:
|
||||||
return "Game mode setter {0} not found.".format(args)
|
return 'Game mode setter \u0002{}\u0002 not found.'.format(args)
|
||||||
|
|
||||||
game.__doc__ = fgame_help
|
|
||||||
|
fgame.__doc__ = fgame_help
|
||||||
|
|
||||||
|
|
||||||
# DO NOT MAKE THIS A PMCOMMAND ALSO
|
# DO NOT MAKE THIS A PMCOMMAND ALSO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user