From 2f14ba690c81260f382bdf2eae814533d8aad69b Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 29 Aug 2018 16:34:07 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=93=E3=82=93=E3=81=AB=E3=81=A1=E3=81=AF?= =?UTF-8?q?=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/core/index.ts | 12 ++++++++++++ src/serifs.ts | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/modules/core/index.ts b/src/modules/core/index.ts index d0db3b4..5e06499 100644 --- a/src/modules/core/index.ts +++ b/src/modules/core/index.ts @@ -120,6 +120,18 @@ export default class CoreModule implements IModule { msg.friend.incLove(); }; + if (msg.text.includes('こんにちは')) { + if (msg.friend.name) { + msg.reply(serifs.core.helloWithName.replace('{name}', msg.friend.name)); + } else { + msg.reply(serifs.core.hello); + } + + incLove(); + + return true; + } + if (msg.text.includes('おはよ')) { if (msg.friend.name) { msg.reply(serifs.core.goodMorningWithName.replace('{name}', msg.friend.name)); diff --git a/src/serifs.ts b/src/serifs.ts index b9ebae4..0b907ee 100644 --- a/src/serifs.ts +++ b/src/serifs.ts @@ -3,6 +3,8 @@ export default { setNameOk: 'わかりました。これからは{name}とお呼びしますね!', san: 'さん付けした方がいいですか?', yesOrNo: '「はい」か「いいえ」しかわからないんです...', + hello: 'こんにちは♪', + helloWithName: 'こんにちは、{name}♪', goodMorning: 'おはようございます!', goodMorningWithName: 'おはようございます、{name}!', goodNight: 'おやすみなさい!',