Validate name

This commit is contained in:
syuilo 2018-08-28 13:07:53 +09:00
parent 8d0992d8d5
commit eb6c1021e9
2 changed files with 6 additions and 0 deletions

View file

@ -80,6 +80,11 @@ export default class CoreModule implements IModule {
return true;
}
if (name.includes('@')) {
msg.reply(serifs.core.invalidName);
return true;
}
const titles = ['さん', 'くん', '君', 'ちゃん', '様', '先生'];
const withSan = titles.some(t => name.endsWith(t));

View file

@ -8,6 +8,7 @@ export default {
goodNight: 'おやすみなさい!',
goodNightWithName: 'おやすみなさい、{name}',
tooLong: '長すぎる気がします...',
invalidName: '発音が難しい気がします',
requireMoreLove: 'もっと仲良くなったら考えてあげてもいいですよ?',
happyBirthday: 'お誕生日おめでとうございます🎉',
happyBirthdayWithName: 'お誕生日おめでとうございます、{name}🎉',