plugins/rtbl_admin.lua

changeset 167
2073137bc943
parent 166
95b668d73ff9
child 168
1c2b8d10ceed
equal deleted inserted replaced
166:95b668d73ff9 167:2073137bc943
30 bot:hook("commands/rtbl-remove", function (command) 30 bot:hook("commands/rtbl-remove", function (command)
31 local reported_jid = command.param and jid.prep(command.param:match("^%S+")); 31 local reported_jid = command.param and jid.prep(command.param:match("^%S+"));
32 local hash = sha256(reported_jid, true); 32 local hash = sha256(reported_jid, true);
33 bot.stream.pubsub(config.host, config.node):retract( 33 bot.stream.pubsub(config.host, config.node):retract(
34 hash, -- item id 34 hash, -- item id
35 true, -- notify subscribers
35 function (success) -- callback 36 function (success) -- callback
36 if not success then 37 if not success then
37 command:reply("Failed to update RTBL"); 38 command:reply("Failed to update RTBL");
38 return; 39 return;
39 end 40 end

mercurial