plugins/groupchat.lua

changeset 160
eb5a04a9877a
parent 143
bad1be5e4674
equal deleted inserted replaced
159:7ca948b157df 160:eb5a04a9877a
25 room.bot = bot; 25 room.bot = bot;
26 bot:event(reflect_events[i], room, ...) 26 bot:event(reflect_events[i], room, ...)
27 end); 27 end);
28 end 28 end
29 29
30 function bot:join_room(room_jid, nick) 30 function bot:join_room(room_jid, nick, password)
31 nick = nick or bot.config.nick or ("bot"..math.random(10000,99999)); 31 nick = nick or bot.config.nick or ("bot"..math.random(10000,99999));
32 local room = bot.stream:join_room(room_jid, nick) 32 local room = bot.stream:join_room(room_jid, nick, password)
33 room.bot = bot; 33 room.bot = bot;
34 room:hook("message", function(event) 34 room:hook("message", function(event)
35 if event.nick == room.nick then 35 if event.nick == room.nick then
36 return true; 36 return true;
37 end 37 end

mercurial