plugins/commands.lua

changeset 102
b7c9a3707e68
parent 58
3e5b57d44fa0
child 159
7ca948b157df
equal deleted inserted replaced
101:7d75d7f9d5ae 102:b7c9a3707e68
17 command, hasparam, param = body:match(direct_address_pattern); 17 command, hasparam, param = body:match(direct_address_pattern);
18 end 18 end
19 19
20 if not command then 20 if not command then
21 command, hasparam, param = body:match("%[([%a%-%_%d]+)(%s?)(.*)%]"); 21 command, hasparam, param = body:match("%[([%a%-%_%d]+)(%s?)(.*)%]");
22 if event.room then
23 local direct_to = body:match"^(.-)[,:]"
24 if event.room.occupants[direct_to] then
25 event.reply_to = direct_to
26 end
27 end
22 end 28 end
23 29
24 if hasparam ~= " " then param = nil; end 30 if hasparam ~= " " then param = nil; end
25 31
26 if command then 32 if command then

mercurial