mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
chore: 优化telegram更多保留字符
This commit is contained in:
@@ -60,7 +60,9 @@ export class TelegramNotification extends BaseNotification {
|
|||||||
|
|
||||||
replaceText(text: string) {
|
replaceText(text: string) {
|
||||||
// .*()<> 等都需要用\\进行替换
|
// .*()<> 等都需要用\\进行替换
|
||||||
return text.replace(/[\\.*()<>]/g, '\\$&');
|
return text.replace(/[_*[\]()~`>#\+\-=|{}.!]/g, '\\$&');
|
||||||
|
// .replace(/([\\_*`|!.[\](){}>+#=~-])/gm, '\\$1')
|
||||||
|
// return text.replace(/[\\.*()<>]/g, '\\$&');
|
||||||
}
|
}
|
||||||
async send(body: NotificationBody) {
|
async send(body: NotificationBody) {
|
||||||
if (!this.botToken || !this.chatId) {
|
if (!this.botToken || !this.chatId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user