Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not LSAC then return end
- if not Discord.Config.Relay.LSAC then
- Discord:Log('LSAC integration disabled, not loading...')
- return
- end
- if not Discord.Config.Relay.Channels.Admin or Discord.Config.Relay.Channels.Admin == '' then
- Discord:Log('LSAC integration couldn\'t be enabled, no admin channel configured.')
- return
- end
- Discord:Log('Enabling LSAC integration...')
- hook.Add('LSAC.logs.CreatePlayerLog', 'Discord_LSAC', function(ply, module, reason, kickonly, logonly)
- local title = ply:Name() .. ' (' .. ply:SteamID() .. ')'
- Discord.SS:Request(ply, 70, function(err, url)
- if err then
- Discord.Backend.API:Send(
- Discord.OOP:New('Message'):SetChannel('Admin'):SetEmbed({
- color = 0x3498db,
- description = Discord.Util:GetLang('LSAC_DESCRIPTION_ERROR', {
- detections = reason,
- error = err,
- }),
- title = title,
- }):ToAPI()
- )
- return
- end
- Discord.Backend.API:Send(
- Discord.OOP:New('Message'):SetChannel('Admin'):SetEmbed({
- color = 0x3498db,
- description = Discord.Util:GetLang('LSAC_DESCRIPTION', {
- detections = reason,
- url = url,
- }),
- title = title,
- image = {
- url = url,
- },
- }):ToAPI()
- )
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment