generated from Baipyrus/DiscordJS-Template
filter duplicate words
This commit is contained in:
parent
6ec1892a80
commit
034beca51c
@ -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[]} */
|
||||
|
Loading…
Reference in New Issue
Block a user