ircbot/basic.py

22 lines
446 B
Python
Raw Permalink Normal View History

2022-10-21 22:09:55 +00:00
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:])))