5 |
5 |
6 function riddim.plugins.trac(bot) |
6 function riddim.plugins.trac(bot) |
7 local trac = bot.config.trac; |
7 local trac = bot.config.trac; |
8 if not trac then return end |
8 if not trac then return end |
9 |
9 |
10 --require "net.httpclient_listener"; |
10 require "net.httpclient_listener"; |
11 local http = --require("net.http"); |
11 local http = require("net.http"); |
12 { request = function(url, iduno, callback) |
|
13 local data = io.popen("curl -s " .. url):read("*a"); |
|
14 return callback(data, 200); |
|
15 end; } |
|
16 |
12 |
17 bot:hook("commands/ticket", function(command) |
13 bot:hook("commands/ticket", function(command) |
18 if not command.param then return end |
14 if not command.param then return end |
19 local bug_id = s_match(command.param, "%d+"); |
15 local bug_id = s_match(command.param, "%d+"); |
20 if not bug_id then return end |
16 if not bug_id then return end |