Skip to content

Commit

Permalink
Fix discord and slack plugin when sending
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileDiot committed May 23, 2023
1 parent b95837e commit 0aa84c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions discord/discord.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local class = require "middleclass"
local plugin = require "bunkerweb.plugin"
local utils = require "bunkerweb.utils"
local cjson = require "cjson"
local http = require "resty.http"
local class = require "middleclass"
local plugin = require "bunkerweb.plugin"
local utils = require "bunkerweb.utils"
local cjson = require "cjson"
local http = require "resty.http"

local discord = class("discord", plugin)
local discord = class("discord", plugin)

function discord:initialize()
-- Call parent initialize
Expand Down Expand Up @@ -43,7 +43,7 @@ function discord:log(bypass_use_discord)
end
end

function discord:send(premature, data)
function discord:send(self, data)
local httpc, err = http.new()
if not httpc then
self.logger:log(ngx.ERR, "can't instantiate http object : " .. err)
Expand Down Expand Up @@ -97,4 +97,4 @@ function discord:log_default()
return self:log(true)
end

return discord
return discord
16 changes: 8 additions & 8 deletions slack/slack.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local class = require "middleclass"
local plugin = require "bunkerweb.plugin"
local utils = require "bunkerweb.utils"
local cjson = require "cjson"
local http = require "resty.http"
local class = require "middleclass"
local plugin = require "bunkerweb.plugin"
local utils = require "bunkerweb.utils"
local cjson = require "cjson"
local http = require "resty.http"

local slack = class("slack", plugin)
local slack = class("slack", plugin)

function slack:initialize()
-- Call parent initialize
Expand Down Expand Up @@ -43,7 +43,7 @@ function slack:log(bypass_use_slack)
end
end

function slack:send(premature, data)
function slack:send(self, data)
local httpc, err = http.new()
if not httpc then
self.logger:log(ngx.ERR, "can't instantiate http object : " .. err)
Expand Down Expand Up @@ -97,4 +97,4 @@ function slack:log_default()
return self:log(true)
end

return slack
return slack

0 comments on commit 0aa84c5

Please sign in to comment.