server=nil service=nil return function()if server.Settings.DiscordLogging then debugPrint("\068\105\115\099\111\114\100 \108\111\103\103\105\110\103 \101\110\097\098\108\101\100\046")debugPrint("\083\101\116 \068\105\115\099\111\114\100 \095\071 \065\080\073")_G.Discord=server.Discord server.Discord={Log=function(Q,M,J)if server.Settings.DiscordLogging==false or server.Settings.DiscordWebhookID==""or server.Settings.DiscordWebhookToken==""then warn("\068\105\115\099\111\114\100 \108\111\103 \110\111\116 \101\110\097\098\108\101\100\044 \111\114 \105\116\'\115 \115\101\116 \116\111 \116\114\117\101 \097\110\100 \110\111 \116\111\107\101\110 \111\114 \073\068 \105\115 \098\101\105\110\103 \112\114\111\118\105\100\101\100\046")end local w={}w.embeds={{}}w.embeds[1].title="\069\108\101\099\116\114\097 \108\111\103"w.embeds[1].fields={{name="\080\108\097\121\101\114",value=tostring(Q)},{name="\065\099\116\105\111\110",value=tostring(M)};{name="\073\110\102\111";value=tostring(J)}}server.Functions.PostEmbed(w)end}else debugPrint("\068\105\115\099\111\114\100 \108\111\103\103\105\110\103 \100\105\115\097\098\108\101\100\046")end end
server = nil
service = nil

return function()

    if server.Settings.DiscordLogging then
        debugPrint('Discord logging enabled.')

        debugPrint('Set Discord _G API')
        _G.Discord = server.Discord --// _G Var that will be used for discord logs if the user wants (so it can be used by the user outside of exploit logs for custom applications)

        server.Discord = {

            Log = function(Player, Action, Info) 
                if server.Settings.DiscordLogging == false or server.Settings.DiscordWebhookID == "" or server.Settings.DiscordWebhookToken == "" then 
                    warn("Discord log not enabled, or it's set to true and no token or ID is being provided.")
                end
                local info = {}
                info.embeds = {{}}
                info.embeds[1].title = 'Electra log'
                info.embeds[1].fields = {{name = 'Player',value = tostring(Player)},{name = 'Action',value = tostring(Action)},{name = 'Info',value = tostring(Info)}}
                server.Functions.PostEmbed(info)
            end;
            
        }

    else
        debugPrint('Discord logging disabled.')
    end

end