Description="Channel where sentry news (monitored users joins and messages) will be posted",
Type=bot.ConfigType.Channel,
Optional=true
},
{
Name="JoinAlert",
Description="Message to be posted when a monitored user joins the server (`{userMention}` will be replaced by the user mention, `{userTag}` will be replaced by the user name, `{userId}` will be replaced by the user id)",
Type=bot.ConfigType.String,
Default="The monitored user {userTag} ({userId}) has joined the server",
},
{
Name="MessageAlert",
Description="Message to be posted when a monitored user sends a message which contains one of optionally keywords (`{userMention}` will be replaced by the user mention, `{userTag}` will be replaced by the user name, `{userId}` will be replaced by the user id, `{message}` will be replaced by the message link)",
Type=bot.ConfigType.String,
Default="The monitored user {userTag} ({userId}) has sent a message : {message}",
},
{
Name="MonitoredJoins",
Description="The users that the bot should monitor. Alert when a monitored user joins the server.",
Type=bot.ConfigType.User,
Default= {},
Array=true,
},
{
Name="MonitoredMessages",
Description="The users that the bot should monitor. Alert when a monitored user sends a message. Map associating a user with keywords.",
Type=bot.ConfigType.Custom,
ValidateConfig=function (value)
if (type(value) ~="table" or#value~=0) then
returnfalse, "MonitoredMessages must be an object"
end
foruserId, keywordsinpairs(value) do
if (notutil.ValidateSnowflake(userId)) then
returnfalse, "MonitoredMessages keys must be user snowflakes"
end
if (type(keywords) ~="table") then
returnfalse, "MonitoredMessages[" ..userId.."] must be an array"