Hi!
I am trying to make a Link Blocker Module work with our webhook.
Right now, it’s erroring for Trush Check Failed at line 29.
What’s wrong?
Thanks!
local module = require(7052867232)
module:SetMode('RemoveMessage') --[[
None: does nothing but links will still be detected
FilterLink: filters the link
RemoveMessage: removes the message
]]
local webhook = "lol i invalidated the link xd"
local http = game:GetService("HttpService")
module:SetCheck(function(player, url, message)
return string.find(url, 'roblox%.com$') == nil
-- return a boolean, above is a example which will not do anything to roblox.com links.
end)
module.Detected:Connect(function(player, url) -- a event, this is also optional
local data ={
['embeds'] = {{
['color'] = 0000,
['tittle'] = "Link Sent, Player kicked.",
['description'] = player.Name,
['fields'] = {
{
['name'] = "Sent a link. Link: ",
['value'] = url,
}
}
}}
}
local newdata = http:JSONEncode(data)
http:PostAsync(url,newdata)
player:Kick("You have put in a link. Links are not permitted. If this is a mistake, contact us and rejoin. Your link has been logged.")
end)
module:Run() -- start
--[[
local url = "[Discord webhook app here]"
local http = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:connect(function(msg)
local data ={
['embeds'] = {{
['color'] = 0000,
['tittle'] = "ChatLog",
['description'] = player.Name,
['fields'] = {
{
['name'] = "CHATTED IN GAME AND SAID;",
['value'] = msg,
}
}
}}
}
local newdata = http:JSONEncode(data)
http:PostAsync(url,newdata)
end)
end)
]]