local cqueues = require("cqueues") local socket = require("cqueues.socket") function callcmd(conn, cmd) conn:write(cmd.."\n") print("response:", conn:read("*l")) end local socketpath = "/tmp/albotty.sock" local conn = socket.connect{path = socketpath} target,msg = ... for line in string.gmatch(msg, "[^\n]+") do callcmd(conn, ("/msg %s %s"):format(target, line)) end conn:close()