Skip to content

Commit a76e990

Browse files
committed
Online bold
When the bot turns on, only ONLINE will appear bold
1 parent 381c5bd commit a76e990

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Serverlogging/server.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local DISCORD_IMAGE = "https://pbs.twimg.com/profile_images/847824193899167744/J
77

88
--DON'T EDIT BELOW THIS
99

10-
PerformHttpRequest(DISCORD_WEBHOOK, function(err, text, headers) end, 'POST', json.encode({username = DISCORD_NAME, content = "**Discord Webhook is ONLINE**", avatar_url = DISCORD_IMAGE}), { ['Content-Type'] = 'application/json' })
10+
PerformHttpRequest(DISCORD_WEBHOOK, function(err, text, headers) end, 'POST', json.encode({username = DISCORD_NAME, content = "Discord Webhook is **ONLINE**", avatar_url = DISCORD_IMAGE}), { ['Content-Type'] = 'application/json' })
1111

1212
AddEventHandler('chatMessage', function(source, name, message)
1313

@@ -36,8 +36,11 @@ AddEventHandler('playerConnecting', function()
3636
end)
3737

3838
AddEventHandler('playerDropped', function(reason)
39-
--PerformHttpRequest(DISCORD_WEBHOOK, function(err, text, headers) end, 'POST', json.encode({username = DISCORD_NAME, content = "```fix\n".. GetPlayerName(source) .. " left ( ".. reason .. " )\n```", avatar_url = DISCORD_IMAGE}), { ['Content-Type'] = 'application/json' })
40-
sendToDiscord("Server Logout", GetPlayerName(source) .. " has left the server. \n Reason: " .. reason, 16711680)
39+
local color = 16711680
40+
if string.match(reason, "Kicked") or string.match(reason, "Banned") then
41+
color == 16007897
42+
end
43+
sendToDiscord("Server Logout", GetPlayerName(source) .. " has left the server. \n Reason: " .. reason, color)
4144
end)
4245

4346
RegisterServerEvent('playerDied')

0 commit comments

Comments
 (0)