From c5ff63805602b05f9b11ecd14c903619e1a568d3 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Sun, 24 Aug 2014 18:14:32 +0200 Subject: [PATCH] Add !fsay and !fact --- modules/wolfgame.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 57a7388..b1783da 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -5629,12 +5629,34 @@ def fpull_pm(cli, nick, rest): fpull(cli, nick, nick, rest) -@pmcmd("fsend", admin_only=True) +@pmcmd('fsend', admin_only=True) def fsend(cli, nick, rest): - print('{0} - {1} fsend - {2}'.format(time.strftime('%Y-%m-%dT%H:%M:%S%z'), nick, rest)) + print('[%s] %s fsend: %s' % + (time.strftime('%Y-%m-%dT%H:%M:%S%z'), nick, rest)) + cli.send(rest) +@pmcmd('fsay', admin_only=True) +def fsay(cli, nick, rest): + rest = rest.split(' ', 1) + + print('[%s] %s fsay %s: %s' % + (time.strftime('%Y-%m-%dT%H:%M:%S%z'), nick, rest[0], rest[1])) + + cli.send('PRIVMSG %s :%s' % (rest[0], rest[1])) + + +@pmcmd('fact', admin_only=True) +def fact(cli, nick, rest): + rest = rest.split(' ', 1) + + print('[%s] %s fact %s: %s' % + (time.strftime('%Y-%m-%dT%H:%M:%S%z'), nick, rest[0], rest[1])) + + cli.send('PRIVMSG %s :\x01ACTION %s\x01' % (rest[0], rest[1])) + + before_debug_mode_commands = list(COMMANDS.keys()) before_debug_mode_pmcommands = list(PM_COMMANDS.keys())