equal
deleted
inserted
replaced
8 require "mcbot.mcbot_engine" |
8 require "mcbot.mcbot_engine" |
9 |
9 |
10 local mcabbot = {} |
10 local mcabbot = {} |
11 mcabbot.nickname = "McBot" |
11 mcabbot.nickname = "McBot" |
12 mcabbot.jid = "mcabbot@lilotux.net" |
12 mcabbot.jid = "mcabbot@lilotux.net" |
|
13 mcabbot.cmdprefix = "%%" |
13 |
14 |
14 local function hk_subscription (h) |
15 local function hk_subscription (h) |
15 if h.type == "subscribe" then |
16 if h.type == "subscribe" then |
16 -- Let's authorize them... |
17 -- Let's authorize them... |
17 main.run("authorization allow "..h.jid) |
18 main.run("authorization allow "..h.jid) |
48 cmd = "say_to -q "..h.jid.." "..h.resource..": " |
49 cmd = "say_to -q "..h.jid.." "..h.resource..": " |
49 else |
50 else |
50 cmd = "say_to -q "..h.jid.."/"..h.resource.." " |
51 cmd = "say_to -q "..h.jid.."/"..h.resource.." " |
51 end |
52 end |
52 mcabbot.message = h |
53 mcabbot.message = h |
53 local res, errmsg = process(message, mcabbot, muc) |
54 local res, errmsg = process(message, mcabbot, muc, mcabbot.cmdprefix) |
54 mcabbot.message = nil |
55 mcabbot.message = nil |
55 if res then |
56 if res then |
56 msg = res |
57 msg = res |
57 elseif errmsg then |
58 elseif errmsg then |
58 msg = "! " .. errmsg |
59 msg = "! " .. errmsg |