iSyriux
(Oneironaut)
August 24, 2020, 2:29am
#1
local httpservice = game:GetService("HttpService")
local api = "https://discordapp.com/api/webhooks/747268872918532120/shk2LGXRX_4v5yRG9aUcJkgUn4dTsIUkR3FomaaRF1ZXkXwlaFR--w598AzdT-K0v32U"
local min = false
game.ReplicatedStorage.Report.OnServerEvent:Connect(function(p,user,reason)
print('ager')
wait()
local data = {
['embeds'] = {{
["author"] = {
["name"] = "Hard Obby Report";
["icon_url"] = {url = game.Players:GetUserThumbnailAsync(p.UserId,Enum.ThumbnailType.AvatarBust,Enum.ThumbnailSize.Size352x352)};
},
["color"] = 392483,
["title"] = p.Name,
["fields"] = {
{
name="**Reported**",
value=user,
},
{
name="**Reason**",
value=reason,
},
},
["footer"] = {
text="Made by iSyriux"
}
}}
}
local newdata = httpservice:JSONEncode(data)
httpservice:PostAsync(api,newdata)
end)
This is my thing but it just shows error 400
HTTPservice is enabled
I am not the owner of the game, but I published the game
3 Likes
DenisxdX3
(DenisX3)
August 24, 2020, 2:31am
#2
Sometimes the Bad Request event is due to HTTP, try it on client and not on studio, i had the same problem with PrivateTeleport bit on client and roblox server it worked
iSyriux
(Oneironaut)
August 24, 2020, 2:31am
#3
Also whoever was spamming βlol β β β β β β β I hope you are happy with yourself
iSyriux
(Oneironaut)
August 24, 2020, 2:32am
#4
Yeah I published it and tried it on client but it still gives error
DenisxdX3
(DenisX3)
August 24, 2020, 2:33am
#5
Have you enabled HTTP on your game?
1 Like
iSyriux
(Oneironaut)
August 24, 2020, 2:35am
#6
Are you joking? I literally said HTTPservice is enabled on the game, and itβs my game
DenisxdX3
(DenisX3)
August 24, 2020, 2:36am
#7
I didnβt see it, other than that idk how to help, i never scripted something like this
Kiansjet
(Kiansjet)
August 24, 2020, 2:37am
#8
This serves as a good lesson though. Be careful with where you post your webhook token.
Also, make sure you migrate to making discord API calls to discord.com , as they will be killing discordapp.com API calls at some point afaik.
Canβt immediately find anything wrong with your call. Can you try sending a simple 1 line message to that webhook to see if the issue is with your embed formatting?
iSyriux
(Oneironaut)
August 24, 2020, 2:40am
#9
Definately a formatting issue.
I was able to send this
local httpservice = game:GetService("HttpService")
local api = "no"
local min = false
game.ReplicatedStorage.Report.OnServerEvent:Connect(function(p,user,reason)
print('ager')
wait()
local data = {
['embeds'] = {{
["color"] = 392483,
["title"] = p.Name,
}}
}
local newdata = httpservice:JSONEncode(data)
httpservice:PostAsync(api,newdata)
end)
iSyriux
(Oneironaut)
August 24, 2020, 2:52am
#11
Itβs still not working you know
iSyriux
(Oneironaut)
August 24, 2020, 2:55am
#12
Please help me I have to go soon
In author object in embeds, the icon url is not meant to be an object, yet it is meant to be a string
2 Likes
iSyriux
(Oneironaut)
August 24, 2020, 2:59am
#14
Then how do you make it a string
By converting it from an object to a string?
2 Likes
iSyriux
(Oneironaut)
August 24, 2020, 3:05am
#16
Ok my next problem is, how do you change the colour
I have put a colour but it always becomes green
That color isnβt valid
DEFAULT: 0,
AQUA: 1752220,
GREEN: 3066993,
BLUE: 3447003,
PURPLE: 10181046,
GOLD: 15844367,
ORANGE: 15105570,
RED: 15158332,
GREY: 9807270,
DARKER_GREY: 8359053,
NAVY: 3426654,
DARK_AQUA: 1146986,
DARK_GREEN: 2067276,
DARK_BLUE: 2123412,
DARK_PURPLE: 7419530,
DARK_GOLD: 12745742,
DARK_ORANGE: 11027200,
DARK_RED: 10038562,
DARK_GREY: 9936031,
LIGHT_GREY: 12370112,
DARK_NAVY: 2899536,
LUMINOUS_VIVID_PINK: 16580705,
DARK_VIVID_PINK: 12320855
1 Like
Kiansjet
(Kiansjet)
August 24, 2020, 3:22am
#19
Just to be clear, are these integer representations of hex colors?
This in hex is #2ECC71
Yes they are integer representations of hex colorids
2 Likes