From e085feae199fd527f3ba382abeefc250ecfbf100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergiusz=20=27q3k=27=20Baza=C5=84ski?= Date: Mon, 4 Nov 2013 12:41:11 +0100 Subject: [PATCH] Less nag and more spaceapi --- plugins/hackerspace.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/hackerspace.lua b/plugins/hackerspace.lua index fe7d6e7..f8cebe1 100644 --- a/plugins/hackerspace.lua +++ b/plugins/hackerspace.lua @@ -1,8 +1,9 @@ plugin.AddCommand('at', 0, function(Username, Channel) + local Body, Code, Headers 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 - local Body, Code, Headers, Status = https.request('https://hskrk-spacemon.herokuapp.com/') + Body, Code, Headers, Status = https.request('https://hskrk-spacemon.herokuapp.com/') else Channel:Say("This is not a hackerspace channel!") 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') if Code == 200 then local Data = json.decode.decode(Body) - if Data['content'] > 0 then + if Data['content'] > 1 then Nagged[Target] = os.time() + 60 * 60 * 24 local Months = 'months' if Data['content'] == 0 then