183 end |
184 end |
184 end |
185 end |
185 end); |
186 end); |
186 end, |
187 end, |
187 save = function() |
188 save = function() |
188 local st = verse.stanza(factoids_node, { xmlns = factoids_xmlns }); |
189 local wrapper = st.stanza(factoids_node, { xmlns = factoids_xmlns }); |
189 for name, text in pairs(factoids) do |
190 for name, text in pairs(factoids) do |
190 st:tag("factoid", { name = name }):text(text):up(); |
191 wrapper:tag("factoid", { name = name }):text(text):up(); |
191 end |
192 end |
192 bot.stream:private_set(factoids_node, factoids_xmlns, st); |
193 bot.stream:private_set(factoids_node, factoids_xmlns, wrapper); |
193 end, |
194 end, |
194 } |
195 } |
195 function actions.add(...) actions.save(); end |
196 function actions.add(...) actions.save(); end |
196 function actions.del(...) actions.save(); end |
197 function actions.del(...) actions.save(); end |
197 bot:hook("started", function() |
198 bot:hook("started", function() |