mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
fix: console.logの削除
This commit is contained in:
parent
66071446a3
commit
180849c23c
1 changed files with 1 additions and 7 deletions
|
@ -63,37 +63,31 @@ export default class extends Module {
|
||||||
@autobind
|
@autobind
|
||||||
private setName(msg: Message): boolean {
|
private setName(msg: Message): boolean {
|
||||||
if (!msg.text) {
|
if (!msg.text) {
|
||||||
console.error("Message text is empty or undefined.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg.text.includes('って呼んで')) {
|
if (!msg.text.includes('って呼んで')) {
|
||||||
console.error("Message text does not include 'って呼んで'.");
|
return false;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.text.startsWith('って呼んで')) {
|
if (msg.text.startsWith('って呼んで')) {
|
||||||
console.error("Message text starts with 'って呼んで'.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const matchResult = msg.text.match(/^(.+?)って呼んで/);
|
const matchResult = msg.text.match(/^(.+?)って呼んで/);
|
||||||
|
|
||||||
if (!matchResult) {
|
if (!matchResult) {
|
||||||
console.error("Name not found in the message text.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = matchResult[1];
|
const name = matchResult[1];
|
||||||
|
|
||||||
if (name.length > 30) {
|
if (name.length > 30) {
|
||||||
console.error("Name length exceeds 10 characters.");
|
|
||||||
msg.reply(serifs.core.tooLong);
|
msg.reply(serifs.core.tooLong);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (safeForInterpolate(name)) {
|
if (safeForInterpolate(name)) {
|
||||||
console.error("Invalid name.");
|
|
||||||
msg.reply(serifs.core.invalidName);
|
msg.reply(serifs.core.invalidName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue