ircbot/basic.py
2022-10-21 23:09:55 +01:00

22 lines
446 B
Python

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:])))