This commit is contained in:
syuilo 2018-10-11 15:38:17 +09:00
parent 030c1e6966
commit 91dda242ad
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
3 changed files with 14 additions and 4 deletions

View file

@ -46,4 +46,6 @@ promiseRetry(retry => {
new (account, modules);
console.log('--- ai started! ---');
}).catch(e => {
console.error('failed to fetch account', e);
});

View file

@ -1,7 +1,7 @@
import from '../../ai';
import IModule, { Result } from '../../module';
import MessageLike from '../../message-like';
import serifs from '../../serifs';
import serifs, { getSerif } from '../../serifs';
import Friend from '../../friend';
import getDate from '../../utils/get-date';
@ -205,7 +205,7 @@ export default class CoreModule implements IModule {
}
//#endregion
msg.reply(
msg.reply(getSerif(
msg.friend.love >= 10 ? serifs.core.nadenade.love3 :
msg.friend.love >= 5 ? serifs.core.nadenade.love2 :
msg.friend.love <= -15 ? serifs.core.nadenade.hate4 :
@ -213,7 +213,7 @@ export default class CoreModule implements IModule {
msg.friend.love <= -5 ? serifs.core.nadenade.hate2 :
msg.friend.love <= -1 ? serifs.core.nadenade.hate1 :
serifs.core.nadenade.normal
);
));
return true;
}

View file

@ -49,7 +49,7 @@ export default {
love2: 'わわっ… 恥ずかしいです',
love3: 'ん… ありがとうございます♪',
love3: ['ん… ありがとうございます♪', 'わっ、なんだか落ち着きますね♪'],
hate1: '…っ! やめてほしいです...',
@ -262,3 +262,11 @@ export default {
cpu: 'サーバーの負荷が高そうです。大丈夫でしょうか...'
}
};
export function getSerif(serif: string | string[]): string {
if (Array.isArray(serif)) {
return serif[Math.floor(Math.random() * serif.length)];
} else {
return serif;
}
}