plugins/github.lua

changeset 130
8c0dd9360228
parent 129
c9da10093c51
child 133
9d75333c8a3f
equal deleted inserted replaced
129:c9da10093c51 130:8c0dd9360228
25 bot:hook("commands/issue", function (command) 25 bot:hook("commands/issue", function (command)
26 local issue_id = tonumber(command.param); 26 local issue_id = tonumber(command.param);
27 if not issue_id then return; end 27 if not issue_id then return; end
28 local current_conf = conf[command.room and command.room.jid] or conf; 28 local current_conf = conf[command.room and command.room.jid] or conf;
29 if not current_conf.user then return end 29 if not current_conf.user then return end
30 assert(http.request(get_issue_url(issue_id), ex, function (issue, code) 30 assert(http.request(get_issue_url(current_conf, issue_id), ex, function (issue, code)
31 if code > 400 then 31 if code > 400 then
32 return command:reply("HTTP Error "..code.." :("); 32 return command:reply("HTTP Error "..code.." :(");
33 end 33 end
34 issue = issue and json.decode(issue); 34 issue = issue and json.decode(issue);
35 if not issue then 35 if not issue then

mercurial