mirror of
https://github.com/syuilo/ai.git
synced 2024-11-21 20:58:00 +00:00
Improve AI
This commit is contained in:
parent
0133b2f172
commit
5b59823edd
|
@ -115,6 +115,8 @@ export default class CoreModule implements IModule {
|
|||
}
|
||||
|
||||
private greet = (msg: MessageLike): boolean => {
|
||||
if (msg.text == null) return false;
|
||||
|
||||
const incLove = () => {
|
||||
//#region 1日に1回だけ親愛度を上げる
|
||||
const today = getDate();
|
||||
|
@ -130,6 +132,10 @@ export default class CoreModule implements IModule {
|
|||
//#endregion
|
||||
};
|
||||
|
||||
const tension = (msg.text.match(/[!!]{2,}/g) || [])
|
||||
.sort((a, b) => a.length < b.length ? 1 : -1)[0]
|
||||
.substr(1);
|
||||
|
||||
if (includes(msg.text, ['こんにちは', 'こんにちわ'])) {
|
||||
msg.reply(serifs.core.hello(msg.friend.name));
|
||||
incLove();
|
||||
|
@ -143,7 +149,7 @@ export default class CoreModule implements IModule {
|
|||
}
|
||||
|
||||
if (includes(msg.text, ['おは', 'お早う'])) {
|
||||
msg.reply(serifs.core.goodMorning(msg.friend.name));
|
||||
msg.reply(serifs.core.goodMorning(tension, msg.friend.name));
|
||||
incLove();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ export default {
|
|||
|
||||
helloNight: name => name ? `こんばんは、${name}♪` : `こんばんは♪`,
|
||||
|
||||
goodMorning: name => name ? `おはようございます、${name}!` : 'おはようございます!',
|
||||
goodMorning: (tension, name) => name ? `おはようございます、${name}!${tension}` : `おはようございます!${tension}`,
|
||||
|
||||
goodNight: name => name ? `おやすみなさい、${name}!` : 'おやすみなさい!',
|
||||
|
||||
|
|
Loading…
Reference in a new issue