So with my game, I’ve had people abuse certain things that we use Discord Webhooks for. One of them being people trying to mention in-game which would cause annoyance on our Discord server. I found out today about an API in Discord called allowed_mentions which will tell the Webhook what it is able to mention on Discord. I want to stop all mentions from going through but I am not sure how to assign nothing to the parse api in Lua. All the documentation on this API I’ve seen has been for other languages such as Javascript. If someone can, please tell me how to assign nothing to parse so the Webhook won’t be able to mention anybody. Here is my current code for this:
game.ReplicatedStorage.SendReport.OnServerEvent:Connect(function(Client,ReportData)
local MessageData = {
content = Client.Name.." has submitted a Report: "..ReportData;
allowed_mentions = {
{
parse = nil
}
}
}
Debounce is basically ratelimiting a certain functionality. You should implement it to your remote to prevent a single person from spamming it multiple times in a row.
Example:
local debounceTbl = {}
game.ReplicatedStorage.SendReport.OnServerEvent:Connect(function(Client,ReportData)
if debounceTbl[Client] and tick() - debounceTbl[Client] < 10 then
return --the player tried to send a report within 10 seconds
end
debounceTbl[Client] = tick()
--code
end)
game.Players.PlayerRemoving:Connect(function(Client)
debounceTbl[Client] = nil --remove them from the table when they leave
end)