client = None def mod_init(cl): global client client = cl def action(msg): return '%cACTION %s%c' % (1, msg, 1) def on_privchat(who, msg): args = msg.split() if len(args) < 1: return cmd = args[0] if cmd == "say": if len(args) < 3: return client.sendto(args[1], ' '.join(args[2:])) if cmd == "act": if len(args) < 3: return client.sendto(args[1], action(' '.join(args[2:])))