@@ -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**" }), { [' 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
1212AddEventHandler (' chatMessage' , function (source , name , message )
1313
3232
3333AddEventHandler (' playerConnecting' , function ()
3434 -- PerformHttpRequest(DISCORD_WEBHOOK, function(err, text, headers) end, 'POST', json.encode({username = DISCORD_NAME, content = "```CSS\n".. GetPlayerName(source) .. " connecting\n```", avatar_url = DISCORD_IMAGE}), { ['Content-Type'] = 'application/json' })
35- sendToDiscord (" Server Login" , GetPlayerName (source ) .. " is connecting to the server." )
35+ sendToDiscord (" Server Login" , GetPlayerName (source ) .. " is connecting to the server." , 65280 )
3636end )
3737
3838AddEventHandler (' playerDropped' , function (reason )
3939 -- 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 disconnected from the server." )
40+ sendToDiscord (" Server Logout" , GetPlayerName (source ) .. " has disconnected from the server." , 16711680 )
4141end )
4242
4343RegisterServerEvent (' playerDied' )
@@ -81,10 +81,10 @@ function stringsplit(input, seperator)
8181 return t
8282end
8383
84- function sendToDiscord (name , message )
84+ function sendToDiscord (name , message , color )
8585 local connect = {
8686 {
87- [" color" ] = " 8663711 " ,
87+ [" color" ] = color ,
8888 [" title" ] = " **" .. name .. " **" ,
8989 [" description" ] = message ,
9090 [" footer" ] = {
0 commit comments