長い名前は弾くように

This commit is contained in:
syuilo 2018-08-27 07:13:04 +09:00
parent 805b25bb51
commit 91995c9340
2 changed files with 6 additions and 0 deletions

View file

@ -26,6 +26,11 @@ export default class CoreModule implements IModule {
const name = msg.text.match(/^(.+?)って呼んで/)[1]; const name = msg.text.match(/^(.+?)って呼んで/)[1];
if (name.length > 10) {
msg.reply(serifs.core.tooLong);
return true;
}
const withSan = const withSan =
name.endsWith('さん') || name.endsWith('さん') ||
name.endsWith('くん') || name.endsWith('くん') ||

View file

@ -7,6 +7,7 @@ export default {
goodMorningWithName: 'おはようございます、{name}', goodMorningWithName: 'おはようございます、{name}',
goodNight: 'おやすみなさい!', goodNight: 'おやすみなさい!',
goodNightWithName: 'おやすみなさい、{name}', goodNightWithName: 'おやすみなさい、{name}',
tooLong: '長すぎる気がします...'
}, },
/** /**