@@ -56,12 +56,13 @@ local colors = { -- https://www.spycolor.com/
56
56
local logQueue = {}
57
57
58
58
RegisterNetEvent (' qb-log:server:CreateLog' , function (name , title , color , message , tagEveryone )
59
+ local postData = {}
59
60
local tag = tagEveryone or false
60
61
local webHook = webhooks [name ] or webhooks [' default' ]
61
62
local embedData = {
62
63
{
63
64
[' title' ] = title ,
64
- [' color' ] = colors [color ] or colors [' default' ],
65
+ [' color' ] = Colors [color ] or Colors [' default' ],
65
66
[' footer' ] = {
66
67
[' text' ] = os.date (' %c' ),
67
68
},
@@ -77,14 +78,13 @@ RegisterNetEvent('qb-log:server:CreateLog', function(name, title, color, message
77
78
logQueue [name ][# logQueue [name ] + 1 ] = {webhook = webHook , data = embedData }
78
79
79
80
if # logQueue [name ] >= 10 then
80
- local postData = { username = ' QB Logs ' , embeds = {}}
81
-
82
- for i = 1 , # logQueue [ name ] do
83
- postData . embeds [ # postData . embeds + 1 ] = logQueue [ name ][ i ]. data [ 1 ]
81
+ if tag then
82
+ postData = { username = ' QB Logs ' , content = ' @everyone ' , embeds = {} }
83
+ else
84
+ postData = { username = ' QB Logs ' , embeds = {}}
84
85
end
85
-
86
+ for i = 1 , # logQueue [ name ] do postData . embeds [ # postData . embeds + 1 ] = logQueue [ name ][ i ]. data [ 1 ] end
86
87
PerformHttpRequest (logQueue [name ][1 ].webhook , function () end , ' POST' , json .encode (postData ), { [' Content-Type' ] = ' application/json' })
87
-
88
88
logQueue [name ] = {}
89
89
end
90
90
end )
0 commit comments