mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-08-31 12:32:48 +09:00
refactor
This commit is contained in:
@ -2,11 +2,10 @@ import autobind from 'autobind-decorator';
|
||||
import Module from '../../module';
|
||||
import Message from '../../message';
|
||||
import serifs from '../../serifs';
|
||||
import { safeForInterpolate } from '../../utils/safe-for-interpolate';
|
||||
|
||||
const titles = ['さん', 'くん', '君', 'ちゃん', '様', '先生'];
|
||||
|
||||
const invalidChars = ['@', '#', '*', ':', '(', '[', ' ', ' '];
|
||||
|
||||
export default class extends Module {
|
||||
public readonly name = 'core';
|
||||
|
||||
@ -87,7 +86,7 @@ export default class extends Module {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (invalidChars.some(c => name.includes(c))) {
|
||||
if (!safeForInterpolate(name)) {
|
||||
msg.reply(serifs.core.invalidName);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user