Advertisement
krtoowar

Untitled

Sep 24th, 2023 (edited)
1,004
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local SendLog = function(Link, D)
  2.     local Link = _G.AutofarmSettings.Webhook
  3.  
  4.     if (Link ~= "") then
  5.         warn("attempting to send log to webhook.")
  6.  
  7.         local Data =
  8.             {
  9.                 ["content"] = "",
  10.                 ["embeds"] = {{
  11.                     ["title"] = "**Username/UserID**:",
  12.                     ["description"] = "AutoFarm",
  13.                     ["color"] = tonumber(0x2B6BE4),
  14.                     ["fields"] = {
  15.                         {
  16.                             ["name"] = "Username:",
  17.                             ["value"] = D[1],
  18.                             ["inline"] = true
  19.                         },
  20.                         {
  21.                             ["name"] = "Wallet:",
  22.                             ["value"] = D[2],
  23.                             ["inline"] = true
  24.                         },
  25.                         {
  26.                             ["name"] = "Profit:",
  27.                             ["value"] = D[3],
  28.                             ["inline"] = true
  29.                         }
  30.                     },
  31.                 }}
  32.             }
  33.         local s,e = pcall(function()
  34.             local http_request = http_request or syn and syn.request
  35.             http_request({Url=Link, Body=game:GetService("HttpService"):JSONEncode(Data), Method = "POST", Headers={["content-type"] = "application/json"}})
  36.         end)
  37.         if (e) then
  38.             warn("error while sending log, mayb incorrect webhook link?")
  39.         end
  40.     end
  41. end
  42. return SendLog
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement