mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-13 11:34:31 +02:00
global-functions: $SendTelegram: try to get the line breaks right
This commit is contained in:
parent
c93d1c4944
commit
54e164e542
1 changed files with 4 additions and 3 deletions
|
@ -776,9 +776,10 @@
|
|||
:global TelegramFixedWidthFont;
|
||||
|
||||
:global CharacterReplace;
|
||||
:global IfThenElse;
|
||||
|
||||
:if ($TelegramFixedWidthFont != true) do={
|
||||
:return $1;
|
||||
:return ($1 . [ $IfThenElse ($2 = "fixed") "\n" "" ]);
|
||||
}
|
||||
|
||||
:local Return $1;
|
||||
|
@ -810,7 +811,7 @@
|
|||
:local Text ("[" . $Identity . "] " . $Subject . "\n\n" . $Message);
|
||||
:if ([ :len $Text ] > 3968) do={
|
||||
:set Text ([ $EscapeMD ([ :pick $Text 0 3840 ] . "...") "fixed" ] . \
|
||||
"\n\n" . [ $SymbolForNotification "scissors" ] . \
|
||||
"\n" . [ $SymbolForNotification "scissors" ] . \
|
||||
[ $EscapeMD "The Telegram message was too long and has been truncated!" "hint" ]);
|
||||
} else={
|
||||
:set Text [ $EscapeMD $Text "fixed" ];
|
||||
|
@ -832,7 +833,7 @@
|
|||
:if ([ :typeof $TelegramQueue ] = "nothing") do={
|
||||
:set TelegramQueue [ :toarray "" ];
|
||||
}
|
||||
:set Text ($Text . [ $UrlEncode ("\n\n" . [ $SymbolForNotification "alarm-clock" ] . \
|
||||
:set Text ($Text . [ $UrlEncode ("\n" . [ $SymbolForNotification "alarm-clock" ] . \
|
||||
[ $EscapeMD ("This message was queued since " . [ / system clock get date ] . \
|
||||
" " . [ / system clock get time ] . " and may be obsolete.") "hint" ]) ]);
|
||||
:set ($TelegramQueue->[ :len $TelegramQueue ]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue