16 |
16 |
17 if hasparam ~= " " then param = nil; end |
17 if hasparam ~= " " then param = nil; end |
18 |
18 |
19 if command then |
19 if command then |
20 local command_event = { |
20 local command_event = { |
21 command = command, |
21 command = command, |
22 param = param, |
22 param = param, |
23 sender = event.sender, |
23 sender = event.sender, |
24 stanza = event.stanza, |
24 stanza = event.stanza, |
25 reply = event.reply, |
25 reply = event.reply, |
26 room = event.room, -- groupchat support |
26 room = event.room, -- groupchat support |
27 }; |
27 }; |
28 local ret = bot:event("commands/"..command, command_event); |
28 local ret = bot:event("commands/"..command, command_event); |
29 if type(ret) == "string" then |
29 if type(ret) == "string" then |
30 event:reply(ret); |
30 event:reply(ret); |
31 end |
31 end |
32 return ret; |
32 return ret; |