small tweaks
This commit is contained in:
1 parent
4817b092fb
commit
854482094a
3 files changed
+9
-9
No files matched your search
@@ -1,7 +1,7 @@
|
||||
Logs = Logs or {}
|
||||
|
||||
local WebhookURL = "" -- Add webhook URL here if using built-in logging system
|
||||
local LogoForEmbed = "" -- optional logo for the embed
|
||||
local WebhookURL = BridgeServerConfig.WebhookURL -- Add webhook URL here if using built-in logging system
|
||||
local LogoForEmbed = BridgeServerConfig.WebhookImage -- optional logo for the embed
|
||||
|
||||
---This will send a log to the configured webhook or log system.
|
||||
---@param src number
|
||||
@@ -9,7 +9,8 @@ local LogoForEmbed = "" -- optional logo for the embed
|
||||
---@return nil
|
||||
Logs.Send = function(src, message)
|
||||
if not src or not message then return end
|
||||
if BridgeServerConfig.LogSystem == "built-in" then
|
||||
local logType = BridgeServerConfig.LogSystem or "built-in"
|
||||
if logType == "built-in" then
|
||||
PerformHttpRequest(WebhookURL, function(err, text, headers) end, 'POST', json.encode(
|
||||
{
|
||||
username = "Community_Bridge's Logger",
|
||||
@@ -19,7 +20,6 @@ Logs.Send = function(src, message)
|
||||
color = "15769093",
|
||||
title = GetCurrentResourceName(),
|
||||
url = 'https://discord.gg/Gm6rYEXUsn',
|
||||
--description = message,
|
||||
thumbnail = { url = LogoForEmbed },
|
||||
fields = {
|
||||
{
|
||||
@@ -46,9 +46,9 @@ Logs.Send = function(src, message)
|
||||
}
|
||||
}
|
||||
}), { ['Content-Type']= 'application/json' })
|
||||
elseif BridgeServerConfig.LogSystem == "qb" then
|
||||
elseif logType == "qb" then
|
||||
return TriggerEvent('qb-log:server:CreateLog', GetCurrentResourceName(), GetCurrentResourceName(), 'green', message)
|
||||
elseif BridgeServerConfig.LogSystem == "ox_lib" then
|
||||
elseif logType == "ox_lib" then
|
||||
return lib.logger(src, GetCurrentResourceName(), message)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -299,12 +299,12 @@ end
|
||||
---@param src number
|
||||
---@param status boolean
|
||||
---@return boolean
|
||||
Framework.SetPlayerDuty = function(src, dutystatus)
|
||||
Framework.SetPlayerDuty = function(src, status)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return false end
|
||||
local job = xPlayer.getJob()
|
||||
if not job.onDuty then return false end
|
||||
xPlayer.setJob(job.name, job.grade, dutystatus)
|
||||
xPlayer.setJob(job.name, job.grade, status)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
BridgeServerConfig = {}
|
||||
BridgeServerConfig.LogSystem = "built-in" -- [ built-in | qb | ox_lib ]
|
||||
BridgeServerConfig.WebhookURL = "PUT_WEBHOOK_URL_HERE" -- only if using builtin
|
||||
BridgeServerConfig.WebhookURL = "" -- only if using builtin, put in the channels webhook url
|
||||
BridgeServerConfig.WebhookImage = "https://cdn.discordapp.com/avatars/299410129982455808/31ce635662206e8bd0132c34ce9ce683?size=1024"
|
||||
BridgeServerConfig.MaxInventorySlots = 50
|
||||
|
||||
|
||||
Reference in new issue
Block a user