plugins/commands.lua

changeset 16
ae69cea97598
parent 14
3df63aaba9e3
child 33
37caf7bd2021
equal deleted inserted replaced
15:22e6c003a83a 16:ae69cea97598
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;

mercurial