Gamer-Scripter

Feedback

Dec 12th, 2023
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  2. local Window = Library.CreateLib("Test Feedback", DarkTheme)
  3. local Home = Window:NewTab("Test")
  4. local Section = Home:NewSection("Feedback")
  5. local DiscordWebhook = "Your Discord Webhook Here"
  6. Section:NewTextBox("Feedback", "Type Here", function(text)
  7. feedbackMessage = text
  8. end)
  9.  
  10. Section:NewButton("Send Feedback", "Send", function()
  11. if feedbackMessage then
  12. local HttpService = game:GetService("HttpService")
  13. local player = game.Players.LocalPlayer
  14. local username = player.Name
  15. local displayName = player.DisplayName
  16. local userId = player.UserId
  17. local accountAge = player.AccountAge
  18. local gameName = game.Name
  19. local gameId = game.GameId
  20. local executor = identifyexecutor() or "unknown"
  21. local timestamp = os.date("%c")
  22.  
  23. local payload = {
  24. ["embeds"] = {
  25. {
  26. ["title"] = "*Feedback*",
  27. ["description"] = feedbackMessage,
  28. ["color"] = 16711680,
  29. ["fields"] = {
  30. {
  31. ["name"] = "Sent By",
  32. ["value"] = displayName,
  33. ["inline"] = true
  34. },
  35. {
  36. ["name"] = "Username",
  37. ["value"] = username,
  38. ["inline"] = true
  39. },
  40. {
  41. ["name"] = "Display Name",
  42. ["value"] = displayName,
  43. ["inline"] = true
  44. },
  45. {
  46. ["name"] = "User ID",
  47. ["value"] = userId,
  48. ["inline"] = true
  49. },
  50. {
  51. ["name"] = "Account Age",
  52. ["value"] = accountAge .. " days",
  53. ["inline"] = true
  54. },
  55. {
  56. ["name"] = "Game Name",
  57. ["value"] = gameName,
  58. ["inline"] = true
  59. },
  60. {
  61. ["name"] = "Game Id",
  62. ["value"] = gameId,
  63. ["inline"] = true
  64. },
  65. {
  66. ["name"] = "Executor",
  67. ["value"] = executor,
  68. ["inline"] = true
  69. }
  70. },
  71. ["footer"] = {
  72. ["text"] = "Time Sent: " .. timestamp
  73. }
  74. }
  75. }
  76. }
  77.  
  78. local payloadJson = HttpService:JSONEncode(payload)
  79.  
  80. local headers = {
  81. ["Content-Type"] = "application/json"
  82. }
  83.  
  84. local success, errorMessage = pcall(function()
  85. HttpService:PostAsync(DiscordWebhook, payloadJson, Enum.HttpContentType.ApplicationJson, false, headers)
  86. end)
  87.  
  88. if success then
  89. game.StarterGui:SetCore("SendNotification", {
  90. Title = "Success",
  91. Text = "Feedback sent successfully to Discord!",
  92. Duration = 5
  93. })
  94. else
  95. game.StarterGui:SetCore("SendNotification", {
  96. Title = "Error",
  97. Text = "Failed to send feedback to Discord: " .. errorMessage,
  98. Duration = 5
  99. })
  100. end
  101. else
  102. game.StarterGui:SetCore("SendNotification", {
  103. Title = "Error",
  104. Text = "Please enter feedback before sending.",
  105. Duration = 5
  106. })
  107. end
  108. end)
Advertisement
Add Comment
Please, Sign In to add comment