chore: 优化telegram更多保留字符

This commit is contained in:
xiaojunnuo
2025-12-15 22:21:43 +08:00
parent 16f6365b18
commit d9e6dbf889
@@ -60,7 +60,9 @@ export class TelegramNotification extends BaseNotification {
replaceText(text: string) {
// .*()<> 等都需要用\\进行替换
return text.replace(/[\\.*()<>]/g, '\\$&');
return text.replace(/[_*[\]()~`>#\+\-=|{}.!]/g, '\\$&');
// .replace(/([\\_*`|!.[\](){}>+#=~-])/gm, '\\$1')
// return text.replace(/[\\.*()<>]/g, '\\$&');
}
async send(body: NotificationBody) {
if (!this.botToken || !this.chatId) {