Avoid exactly reposting old messages.

npm audit
This commit is contained in:
Charlie Laabs
2022-01-12 18:41:36 -06:00
parent b7597b57a6
commit 46092e3274
4 changed files with 16 additions and 10 deletions

View File

@@ -60,7 +60,9 @@ const markovOpts: MarkovConstructorOptions = {
const markovGenerateOptions: MarkovGenerateOptions<MarkovDataCustom> = {
filter: (result): boolean => {
return result.score >= config.minScore;
return (
result.score >= config.minScore && !result.refs.some((ref) => ref.string === result.string)
);
},
maxTries: config.maxTries,
};