Is there any way to prevent the message from sending to discord if the textbox is empty
local HttpService = game:GetService("HttpService")
local Webhook = game.ReplicatedStorage.Webhook.Value
local player = game:GetService("Players")
game.ReplicatedStorage.Report.OnServerEvent:Connect(function(player,reason)
local FilteredString = game:GetService("Chat"):FilterStringForBroadcast(reason,player)
local data =
{
["content"] = "@here";
["embeds"] = {{
["title"] = player.Name.." Has sent a feedback";
["description"] = reason;
["color"] = tonumber(0xADD8E6);
["author"] = {
["name"] = player.Name;
};
}}
}
local finaldata = HttpService:JSONEncode(data)
HttpService:PostAsync(Webhook, finaldata)
end)
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.Report:FireServer(script.Parent.Parent.uitext.Text)
end)