Skip to content

Commit c377ec6

Browse files
authored
Merge pull request #6571 from DuolaD/master
Fix the issue where Telegram bots would not push notifications.
2 parents 1519745 + a2c2b7f commit c377ec6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notify/telegram.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ telegram_send() {
3434
fi
3535
_saveaccountconf_mutable TELEGRAM_BOT_URLBASE "$TELEGRAM_BOT_URLBASE"
3636

37-
_subject="$(printf "%s" "$_subject" | sed 's/\\/\\\\\\\\/g' | sed 's/\]/\\\\\]/g' | sed 's/\([-_*[()~`>#+\-=|{}.!]\)/\\\\\1/g')"
38-
_content="$(printf "%s" "$_content" | sed 's/\\/\\\\\\\\/g' | sed 's/\]/\\\\\]/g' | sed 's/\([-_*[()~`>#+\-=|{}.!]\)/\\\\\1/g')"
37+
_subject="$(printf "%s" "$_subject" | sed -E 's/([][()~`>#+=|{}.!*_\\-])/\\\\\1/g')"
38+
_content="$(printf "%s" "$_content" | sed -E 's/([][()~`>#+=|{}.!*_\\-])/\\\\\1/g')"
3939
_content="$(printf "*%s*\n%s" "$_subject" "$_content" | _json_encode)"
4040
_data="{\"text\": \"$_content\", "
4141
_data="$_data\"chat_id\": \"$TELEGRAM_BOT_CHATID\", "

0 commit comments

Comments
 (0)