filter duplicate words

This commit is contained in:
Baipyrus 2024-04-10 07:57:52 +02:00
parent 6ec1892a80
commit 034beca51c

View File

@ -15,7 +15,8 @@ export async function execute(message) {
.flatMap((word) => {
const without = word.replace(/[^\w\s]/g, '');
return without !== word ? [word, without] : word;
});
})
.filter((w, i, a) => a.indexOf(w) === i);
// Get guild keywords
/** @type {import('../../models/keywords.js').Keyword[]} */