From f587d4043c8383dc9e19db85edf92cc11b40a88b Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 15 Aug 2018 01:49:31 +0900 Subject: [PATCH] :v: --- src/modules/keyword/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/keyword/index.ts b/src/modules/keyword/index.ts index b9305e7..a66955c 100644 --- a/src/modules/keyword/index.ts +++ b/src/modules/keyword/index.ts @@ -46,7 +46,8 @@ export default class KeywordModule implements IModule { console.log(keywords); - const keyword = keywords.sort((a, b) => a[0].length < b[0].length ? 1 : -1)[0]; + const rnd = Math.floor((1 - Math.sqrt(Math.random())) * keywords.length); + const keyword = keywords.sort((a, b) => a[0].length < b[0].length ? 1 : -1)[rnd]; const text = serifs.KEYWORD .replace('{word}', keyword[0])