diff --git a/plugins/notifications.lua b/plugins/notifications.lua index 0c9b15d..99ae7c0 100644 --- a/plugins/notifications.lua +++ b/plugins/notifications.lua @@ -26,14 +26,12 @@ local CheckNotifications = function() end local Notification = json.decode.decode(Data) local Line = "" - if Notification['Notice'] ~= nil then - Line = "NOTICE " .. Notification['Receiver'] .. " :" .. Notification['Message'] - else - Line = "PRIVMSG " .. Notification['Receiver'] .. " :" .. Notification['Message'] - end print("Sending notification: " .. Line) - irc:_Send(Line) - + if Notification['Notice'] ~= nil then + irc:Notice(Notification['Receiver'], Notification['Message']) + else + irc:Say(Notification['Receiver'], Notification['Message']) + end Redis:lrem('notifications:processing', -1, Data) end Redis:quit() @@ -48,7 +46,7 @@ plugin.AddHook('ReactorTick', 'notifications', function() if irc == nil then return end - if LastGlobalChecked + 5 < os.time() then + if LastGlobalChecked + 1 < os.time() then LastGlobalChecked = os.time() pcall(function() CheckNotifications(irc)