Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add logging avatar #272

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions modules/logger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ local allowedErr = {
---@param payload Log Queue
local function logPayload(payload)
local tags

local username = 'QBX Logs'
local avatarUrl = 'https://qbox-project.github.io/qbox-duck.png'

if payload.tags then
for i = 1, #payload.tags do
if not tags then tags = '' end
Expand All @@ -71,7 +73,7 @@ local function logPayload(payload)
requestDelay = resetDelay * 1000 / 10
end
end
end, 'POST', json.encode({content = tags, embeds = payload.embed}), { ['Content-Type'] = 'application/json' })
end, 'POST', json.encode({username = username, avatar_url = avatarUrl, content = tags, embeds = payload.embed}), { ['Content-Type'] = 'application/json' })
end

---Log Queue
Expand Down Expand Up @@ -115,7 +117,7 @@ local function discordLog(log)
},
description = log.message,
author = {
name = 'QBX Logs',
name = log.source,
},
}
}
Expand Down Expand Up @@ -153,4 +155,4 @@ end

return {
log = createLog
}
}
Loading