mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 12:54:28 +02:00
global-functions: $SendTelegram: change internal wording
This commit is contained in:
parent
54e164e542
commit
d7725540f8
1 changed files with 5 additions and 5 deletions
|
@ -779,12 +779,12 @@
|
|||
:global IfThenElse;
|
||||
|
||||
:if ($TelegramFixedWidthFont != true) do={
|
||||
:return ($1 . [ $IfThenElse ($2 = "fixed") "\n" "" ]);
|
||||
:return ($1 . [ $IfThenElse ($2 = "body") "\n" "" ]);
|
||||
}
|
||||
|
||||
:local Return $1;
|
||||
:local Chars {
|
||||
"fixed"={ "\\"; "`" };
|
||||
"body"={ "\\"; "`" };
|
||||
"hint"={ "_"; "*"; "["; "]"; "("; ")"; "~"; "`"; ">";
|
||||
"#"; "+"; "-"; "="; "|"; "{"; "}"; "."; "!" };
|
||||
}
|
||||
|
@ -792,7 +792,7 @@
|
|||
:set Return [ $CharacterReplace $Return $Char ("\\" . $Char) ];
|
||||
}
|
||||
|
||||
:if ($2 = "fixed") do={
|
||||
:if ($2 = "body") do={
|
||||
:return ("```\n" . $Return . "\n```");
|
||||
}
|
||||
|
||||
|
@ -810,11 +810,11 @@
|
|||
|
||||
:local Text ("[" . $Identity . "] " . $Subject . "\n\n" . $Message);
|
||||
:if ([ :len $Text ] > 3968) do={
|
||||
:set Text ([ $EscapeMD ([ :pick $Text 0 3840 ] . "...") "fixed" ] . \
|
||||
:set Text ([ $EscapeMD ([ :pick $Text 0 3840 ] . "...") "body" ] . \
|
||||
"\n" . [ $SymbolForNotification "scissors" ] . \
|
||||
[ $EscapeMD "The Telegram message was too long and has been truncated!" "hint" ]);
|
||||
} else={
|
||||
:set Text [ $EscapeMD $Text "fixed" ];
|
||||
:set Text [ $EscapeMD $Text "body" ];
|
||||
}
|
||||
:set Text [ $UrlEncode $Text ];
|
||||
:local ParseMode [ $IfThenElse ($TelegramFixedWidthFont = true) "MarkdownV2" "" ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue