diff --git a/changelog.md b/changelog.md index 1a4fde2..0061419 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +### 2.0.4 +### Fixed +- Fix Discord Webhooks + ### 2.0.3 ### Fixed - Output Chests (`config.outChest`) work properly now diff --git a/src/logger.lua b/src/logger.lua index ea1dc6b..0d20cd4 100644 --- a/src/logger.lua +++ b/src/logger.lua @@ -8,6 +8,8 @@ local slackName = config.slackName local discordName = config.discordName local externName +local webhookHeaders = {["Content-Type"] = "application/json", ["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"} + local function time() return os.epoch("utc") end @@ -81,28 +83,28 @@ end function logger.externInfo(text) if slackURL then - http.post(slackURL, textutils.serializeJSON({username = externName, text = text}), {["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"}) + http.post(slackURL, textutils.serializeJSON({username = externName, text = text}), webhookHeaders) end if discordURL then - http.post(discordURL, textutils.serializeJSON({username = externName, content = text}), {["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"}) + http.post(discordURL, textutils.serializeJSON({username = externName, content = text}), webhookHeaders) end end function logger.externMention(text) if slackURL then if slackName then - http.post(slackURL, textutils.serializeJSON({username = externName, text = "<@" .. slackName .. "> " .. text}), {["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"}) + http.post(slackURL, textutils.serializeJSON({username = externName, text = "<@" .. slackName .. "> " .. text}), webhookHeaders) else - http.post(slackURL, textutils.serializeJSON({username = externName, text = "<@" .. slackName .. "> " .. text}), {["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"}) + http.post(slackURL, textutils.serializeJSON({username = externName, text = "<@" .. slackName .. "> " .. text}), webhookHeaders) end end if discordURL then if discordName then - http.post(discordURL, textutils.serializeJSON({username = externName, content = "<@" .. discordName .. "> " .. text}), {["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"}) + http.post(discordURL, textutils.serializeJSON({username = externName, content = "<@" .. discordName .. "> " .. text}), webhookHeaders) else - http.post(discordURL, textutils.serializeJSON({username = externName, content = text}), {["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"}) + http.post(discordURL, textutils.serializeJSON({username = externName, content = text}), webhookHeaders) end end end diff --git a/src/main.lua b/src/main.lua index 6f6b15c..7d207b4 100644 --- a/src/main.lua +++ b/src/main.lua @@ -3,7 +3,7 @@ --#include "src/macros.lua" -local versionTag = "v2.0.3" +local versionTag = "v2.0.4" local args = {...} local layoutMode = args[1] == "--layout" or args[1] == "-l"