henoireil

Untitled

Aug 3rd, 2021
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. if not LSAC then return end
  2. if not Discord.Config.Relay.LSAC then
  3. Discord:Log('LSAC integration disabled, not loading...')
  4. return
  5. end
  6.  
  7. if not Discord.Config.Relay.Channels.Admin or Discord.Config.Relay.Channels.Admin == '' then
  8. Discord:Log('LSAC integration couldn\'t be enabled, no admin channel configured.')
  9. return
  10. end
  11.  
  12. Discord:Log('Enabling LSAC integration...')
  13. hook.Add('LSAC.logs.CreatePlayerLog', 'Discord_LSAC', function(ply, module, reason, kickonly, logonly)
  14. local title = ply:Name() .. ' (' .. ply:SteamID() .. ')'
  15. Discord.SS:Request(ply, 70, function(err, url)
  16. if err then
  17. Discord.Backend.API:Send(
  18. Discord.OOP:New('Message'):SetChannel('Admin'):SetEmbed({
  19. color = 0x3498db,
  20. description = Discord.Util:GetLang('LSAC_DESCRIPTION_ERROR', {
  21. detections = reason,
  22. error = err,
  23. }),
  24. title = title,
  25. }):ToAPI()
  26. )
  27. return
  28. end
  29. Discord.Backend.API:Send(
  30. Discord.OOP:New('Message'):SetChannel('Admin'):SetEmbed({
  31. color = 0x3498db,
  32. description = Discord.Util:GetLang('LSAC_DESCRIPTION', {
  33. detections = reason,
  34. url = url,
  35. }),
  36. title = title,
  37. image = {
  38. url = url,
  39. },
  40. }):ToAPI()
  41. )
  42. end)
  43. end)
Advertisement
Add Comment
Please, Sign In to add comment