mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-15 12:34:27 +02:00
mod/notification-telegram: use :onerror for outer block
This commit is contained in:
parent
e3a15cc6b8
commit
f7ba78702f
1 changed files with 9 additions and 9 deletions
|
@ -17,7 +17,7 @@
|
||||||
:global SendTelegram2;
|
:global SendTelegram2;
|
||||||
|
|
||||||
# flush telegram queue
|
# flush telegram queue
|
||||||
:set FlushTelegramQueue do={ :do {
|
:set FlushTelegramQueue do={ :onerror Err {
|
||||||
:global TelegramQueue;
|
:global TelegramQueue;
|
||||||
:global TelegramMessageIDs;
|
:global TelegramMessageIDs;
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@
|
||||||
/system/scheduler/remove [ find where name="_FlushTelegramQueue" ];
|
/system/scheduler/remove [ find where name="_FlushTelegramQueue" ];
|
||||||
:set TelegramQueue;
|
:set TelegramQueue;
|
||||||
}
|
}
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
# get the chat id
|
# get the chat id
|
||||||
:set GetTelegramChatId do={ :do {
|
:set GetTelegramChatId do={ :onerror Err {
|
||||||
:global TelegramTokenId;
|
:global TelegramTokenId;
|
||||||
|
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
|
@ -94,8 +94,8 @@
|
||||||
:if (($Message->"is_topic_message") = true) do={
|
:if (($Message->"is_topic_message") = true) do={
|
||||||
$LogPrint info $0 ("The thread id is: " . ($Message->"message_thread_id"));
|
$LogPrint info $0 ("The thread id is: " . ($Message->"message_thread_id"));
|
||||||
}
|
}
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
# send notification via telegram - expects one array argument
|
# send notification via telegram - expects one array argument
|
||||||
|
@ -226,12 +226,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
# send notification via telegram - expects at least two string arguments
|
# send notification via telegram - expects at least two string arguments
|
||||||
:set SendTelegram do={ :do {
|
:set SendTelegram do={ :onerror Err {
|
||||||
:global SendTelegram2;
|
:global SendTelegram2;
|
||||||
|
|
||||||
$SendTelegram2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 });
|
$SendTelegram2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 });
|
||||||
} on-error={
|
} do={
|
||||||
:global ExitError; $ExitError false $0;
|
:global ExitError; $ExitError false $0 $Err;
|
||||||
} }
|
} }
|
||||||
|
|
||||||
# send notification via telegram - expects one array argument
|
# send notification via telegram - expects one array argument
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue