aichatの文字列置換を正規表現に変更

This commit is contained in:
tetsuya-ki 2024-09-16 16:27:33 +09:00
parent 7c18952671
commit 63b134146e

View file

@ -174,10 +174,11 @@ export default class extends Module {
} else if (msg.includes([kigo + 'plamo'])) {
type = 'plamo';
}
const reName = RegExp(this.name, "i");
const reKigoType = RegExp(kigo + type, "i");
const question = msg.extractedText
.toLowerCase()
.replace(this.name, '')
.replace(kigo + type, '')
.replace(reName, '')
.replace(reKigoType, '')
.trim();
let text:string, aiChat:AiChat;