How to make an API have nothing in it

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
            }
        }
    }

According to the docs you can just set it to an empty table

local MessageData = {
    content = Client.Name.." has submitted a Report: "..ReportData;
    allowed_mentions = {
        {
            parse = {}
        }
    }
}

Also I’d suggest you to apply some kind of debounce on that remote

1 Like

What is a debounce and why would it be useful for my script?

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)

Further reading: Debounce Patterns | Documentation - Roblox Creator Hub

1 Like

Thank you so much! I’ll most likely implement that now that you mentioned it.