From 5bae80789f99f45edbc7d3337bb1199099149bb1 Mon Sep 17 00:00:00 2001 From: Nathan Manzi Date: Wed, 14 Jul 2010 14:57:43 +0800 Subject: [PATCH] Added 'me' function for action strings. Example: def foo(input, me=None): me("is doing %s" % input) --- core/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/main.py b/core/main.py index 665edbc..aedb0e3 100644 --- a/core/main.py +++ b/core/main.py @@ -25,6 +25,9 @@ class Input(dict): def pm(msg): conn.msg(nick, msg) + def me(msg): + conn.msg(chan, "\x01%s %s\x01" % ("ACTION", msg)) + def notice(msg): conn.cmd('NOTICE', [nick, msg]) @@ -32,7 +35,7 @@ class Input(dict): params=params, nick=nick, user=user, host=host, paraml=paraml, msg=msg, server=conn.server, chan=chan, notice=notice, say=say, reply=reply, pm=pm, bot=bot, - lastparam=paraml[-1]) + me=me, lastparam=paraml[-1]) # make dict keys accessible as attributes def __getattr__(self, key):