New option for the moderation bot: forbid duplicate messages (#516).

This commit is contained in:
John Livingston
2024-09-10 18:59:56 +02:00
parent 651641f63c
commit 5225257bb5
11 changed files with 227 additions and 10 deletions

View File

@ -96,7 +96,7 @@ async function initConfigurationApiRouter (options: RegisterServerOptions, route
req.body.bot = channelOptions.bot
req.body.bot.enabled = false
}
// TODO: Same for forbidSpecialChars: if disabled, don't save reason and tolerance
// TODO: Same for forbidSpecialChars/noDuplicate: if disabled, don't save reason and tolerance
// (disabling for now, because it is not acceptable to load twice the channel configuration.
// Must find better way)
// if (req.body.bot?.enabled === true && req.body.bot.forbidSpecialChars?.enabled === false) {
@ -108,6 +108,7 @@ async function initConfigurationApiRouter (options: RegisterServerOptions, route
// req.body.bot.forbidSpecialChars.tolerance = channelOptions.bot.forbidSpecialChars.tolerance
// req.body.bot.forbidSpecialChars.applyToModerators = channelOptions.bot.forbidSpecialChars.applyToModerators
// req.body.bot.forbidSpecialChars.enabled = false
// ... NoDuplicate...
// }
channelOptions = await sanitizeChannelConfigurationOptions(options, channelInfos.id, req.body)
} catch (err) {