Less nag and more spaceapi
parent
b33193185b
commit
e085feae19
|
@ -1,8 +1,9 @@
|
||||||
plugin.AddCommand('at', 0, function(Username, Channel)
|
plugin.AddCommand('at', 0, function(Username, Channel)
|
||||||
|
local Body, Code, Headers
|
||||||
if Channel.Name == '#hackerspace-pl' then
|
if Channel.Name == '#hackerspace-pl' then
|
||||||
local Body, Code, Headers, Status = https.request('https://hackerspace.pl/spaceapi')
|
Body, Code, Headers, Status = https.request('https://hackerspace.pl/spaceapi')
|
||||||
elseif Channel.Name == "#hackerspace-krk" then
|
elseif Channel.Name == "#hackerspace-krk" then
|
||||||
local Body, Code, Headers, Status = https.request('https://hskrk-spacemon.herokuapp.com/')
|
Body, Code, Headers, Status = https.request('https://hskrk-spacemon.herokuapp.com/')
|
||||||
else
|
else
|
||||||
Channel:Say("This is not a hackerspace channel!")
|
Channel:Say("This is not a hackerspace channel!")
|
||||||
return
|
return
|
||||||
|
@ -85,7 +86,7 @@ plugin.AddHook('irc.Message', 'nag', function(Username, Channel, Message)
|
||||||
local Body, Code, Headers, Status = https.request('https://kasownik.hackerspace.pl/api/months_due/' .. Target .. '.json')
|
local Body, Code, Headers, Status = https.request('https://kasownik.hackerspace.pl/api/months_due/' .. Target .. '.json')
|
||||||
if Code == 200 then
|
if Code == 200 then
|
||||||
local Data = json.decode.decode(Body)
|
local Data = json.decode.decode(Body)
|
||||||
if Data['content'] > 0 then
|
if Data['content'] > 1 then
|
||||||
Nagged[Target] = os.time() + 60 * 60 * 24
|
Nagged[Target] = os.time() + 60 * 60 * 24
|
||||||
local Months = 'months'
|
local Months = 'months'
|
||||||
if Data['content'] == 0 then
|
if Data['content'] == 0 then
|
||||||
|
|
Loading…
Reference in New Issue