mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-05 19:19:35 +00:00
19 lines
427 B
Lua
19 lines
427 B
Lua
---@class Moderation
|
|
local Moderation = {}
|
|
|
|
---@class ModerationResult
|
|
---@field flagged boolean
|
|
---@field reason? string
|
|
|
|
---@param content? string
|
|
---@return ModerationResult
|
|
function Moderation.flag(content)
|
|
local lowered = string.lower(content or "")
|
|
if string.find(lowered, "spam") then
|
|
return { flagged = true, reason = "spam_keyword" }
|
|
end
|
|
return { flagged = false }
|
|
end
|
|
|
|
return Moderation
|