mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
chore: 优化telegram更多保留字符
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user