From bb3122d44a1c26c5eb0e353509d4ff55213cbb02 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 1 Sep 2018 12:10:24 +0900 Subject: [PATCH] :v: --- src/modules/keyword/index.ts | 7 ++----- src/serifs.ts | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/modules/keyword/index.ts b/src/modules/keyword/index.ts index 8364b1d..2ec153e 100644 --- a/src/modules/keyword/index.ts +++ b/src/modules/keyword/index.ts @@ -65,17 +65,14 @@ export default class KeywordModule implements IModule { let text: string; if (exist) { - text = serifs.keyword.remembered - .replace('{reading}', kanaToHira(keyword[8])); + text = serifs.keyword.remembered(kanaToHira(keyword[8])); } else { this.learnedKeywords.insertOne({ keyword: keyword[0], learnedAt: Date.now() }); - text = serifs.keyword.learned - .replace('{word}', keyword[0]) - .replace('{reading}', kanaToHira(keyword[8])); + text = serifs.keyword.learned(keyword[0], kanaToHira(keyword[8])); } this.ai.post({ diff --git a/src/serifs.ts b/src/serifs.ts index 8d43412..f54fc61 100644 --- a/src/serifs.ts +++ b/src/serifs.ts @@ -34,9 +34,9 @@ export default { }, keyword: { - learned: '({word}..... {reading}..... 覚えました)', + learned: (word, reading) => `(${word}..... ${reading}..... 覚えました)`, - remembered: '{reading}!' + remembered: (word) => `${word}` }, /**