· 6 years ago · Dec 09, 2019, 01:30 PM
1local HttpService = game:GetService("HttpService");
2
3function SendMessage(Webhook, Message, Botname)
4 if not string.find(Webhook, "https://discordapp.com/api/webhooks/") then
5 return error("Send a valid URL");
6 end
7 local Name;
8 local WakeUp = game:HttpGet("http://buritoman69.glitch.me");
9 local API = "http://buritoman69.glitch.me/webhook";
10 if (not Message or Message == "" or not Botname) then
11 Name = "GameBot"
12 return error("nil or empty message!")
13 else
14 Name = Botname;
15 end
16 local Body = {
17 ['Key'] = tostring("applesaregood"),
18 ['Message'] = tostring(Message),
19 ['Name'] = Name,
20 ['Webhook'] = Webhook
21 }
22 Body = HttpService:JSONEncode(Body);
23 local Data = game:HttpPost(API, Body, false, "application/json")
24 return Data or nil;
25end
26
27SendMessage("WebHookHere", "MessageHere", "BotNameHere")