-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog.lua
70 lines (59 loc) · 2.16 KB
/
log.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
-- log the person's username and send it over to my webhook
-- for obvious reasons, the webhook is hidden!
-- for safety, and privacy reasons, you're free to look through and analyze my logging code
local logger = {}
local req = (fluxus and fluxus.request) or request
local players = game:GetService("Players")
local http = game:GetService("HttpService")
local localPlayer = players.LocalPlayer
local metadata = {
["username"] = localPlayer.Name,
["colors"] = {
["white"] = 0xFFFFF,
["green"] = 0x00FF00,
["blue"] = 0x1555E3,
["indigo"] = 0x2E2B5F,
["orange"] = 0xFF7F00,
["red"] = 0xFF0000
}
}
local function randomize()
local colors = metadata.colors
local names = {}
for name,_ in pairs(colors) do
table.insert(names, name)
end
local random = names[math.random(1, #names)]
return colors[random]
end
logger.post = function(url)
xpcall(function()
req({
Url = url,
Method = "POST",
Headers = {["Content-Type"] = "application/json"},
Body = http:JSONEncode({
head = "Starry Logger 🐋",
content = "# Thank You!",
embeds = {
{
author = {
name = "Get Starry for Yourself",
icon_url = "https://cdn.discordapp.com/attachments/1185420252633378937/1222057030295224343/8R81USk.png?ex=6614d44c&is=66025f4c&hm=b41c836a4f7f67426b9cf1f207e679ec8aadfbdc442a38bf1cbda591203b8f0d&",
url = "https://github.com/hello-n-bye/starry?tab=readme-ov-file#official-release-"
},
title = "Message Received 📢",
description = "Thank you, **" .. metadata.username .."** for using Starry!",
color = randomize(),
footer = {
text = "Made with 💖 by Suno"
}
}
}
})
})
end, function(err)
warn("💫 Starry Debugger: " .. err)
end)
end
return logger