Categories > Coding > Lua >
Send a message to a discord webhook script
Posted
A simple script that send a message to a discord webhook.
Hoped it helped you guys c:
Note:
Works on all exploits that support the request() function. If you use Synapse you need to modify the code to use syn.request instead of request, Read the synapse docs if you don't know how to modify.
function SendMessage(url, message)
local http = game:GetService("HttpService")
local headers = {
["Content-Type"] = "application/json"
}
local data = {
["content"] = message
}
local body = http:JSONEncode(data)
local response = request({
Url = url,
Method = "POST",
Headers = headers,
Body = body
})
print("Sent")
end
function SendMessageEMBED(url, embed)
local http = game:GetService("HttpService")
local headers = {
["Content-Type"] = "application/json"
}
local data = {
["embeds"] = {
{
["title"] = embed.title,
["description"] = embed.description,
["color"] = embed.color,
["fields"] = embed.fields,
["footer"] = {
["text"] = embed.footer.text
}
}
}
}
local body = http:JSONEncode(data)
local response = request({
Url = url,
Method = "POST",
Headers = headers,
Body = body
})
print("Sent")
end
--Examples
local url = ""
SendMessage(url, "Hello")
local embed = {
["title"] = "This is an embedded message",
["description"] = "This message has an embed with fields and a footer",
["color"] = 65280,
["fields"] = {
{
["name"] = "Field 1",
["value"] = "This is the first field"
},
{
["name"] = "Field 2",
["value"] = "This is the second field"
}
},
["footer"] = {
["text"] = "This is the footer text"
}
}
SendMessageEMBED(url, embed)
https://media.discordapp.net/attachments/1134643100715855893/1138795549244539011/SiggyOnGod.png
Replied
Very good, however it has security flaws as every roblox script does that includes webhooks on the client side.
I would recommend actually sending messages through an external server that you own.
I recommend maybe writing something quickly in php (if you do not know it that is fine! just giving some tips for the future if you didn't know,) that can essentially do the same thing. It will take up less lines if done correctly, while also being more secure, and you can even include a filter to prevent spam!
Albeit, this was a great project that you have made. I didn't even think it was possible in Roblox using the HttpGet service as when I tried one time in development for a Roblox game it failed. Keep up the great work!
Cancel
Post
Ty for rep: Swiney, Byoke, Lion, Locust, Waves, Weeb, Nickk, darkn, Atari, CubeFaces, Lux14, Rice, Delta, Syraxes, Aeon, Jordan, Pluto, and Hiroku!
P.S, I like cats better too!
https://media.discordapp.net/attachments/1134643100715855893/1138795549244539011/SiggyOnGod.png
Replied
@Aetheron, this is really cool but however you should do stuff like this via PHP or Node.JS with some stuff in Lua (like sending the request but not showing the JSON on the client side)
but this is really good for a point and i'd probably do something similar like this :D
seems like you did some effort in this script which I think is good for you and other people can learn off of you if you keep on doing this!
i realised you noted this in your thread but do this since it makes it support all exploits:
local RequestFunction = (syn and syn.request) or request or http.request or http_request
RequestFunction({
-- add your request here that supports both UNC and Synapse X Standards
})
This allows support for Synapse X as it doesn't support UNC (exploits that uses UNC for their exploit will use request, http.request or http_request)
Cancel
Post
We Hate VOID
Replied
@atariXD, I understand but I don't know PHP much, I'm willing to learn though.
Cancel
Post
https://media.discordapp.net/attachments/1134643100715855893/1138795549244539011/SiggyOnGod.png
i use arch btw
Replied
I am sorry... Also hi Whoman, I remember you from a while ago! I used to see you active a lot more but not as much recently. I am glad to see you still actually sometimes visit the site! How have you been, my friend?
Cancel
Post
Ty for rep: Swiney, Byoke, Lion, Locust, Waves, Weeb, Nickk, darkn, Atari, CubeFaces, Lux14, Rice, Delta, Syraxes, Aeon, Jordan, Pluto, and Hiroku!
P.S, I like cats better too!
Replied
@Murz yeah there just hasnt been that much on wrd, just "rate this ui" with the most basic ui ever and "omg jjsploit no work im literally gonna die" or crazy code that i dont understand
Cancel
Post
i use arch btw
Ty for rep: Swiney, Byoke, Lion, Locust, Waves, Weeb, Nickk, darkn, Atari, CubeFaces, Lux14, Rice, Delta, Syraxes, Aeon, Jordan, Pluto, and Hiroku!
P.S, I like cats better too!
Replied
Uhh cool, vouch
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post