mod/notification-telegram: introduce $PurgeTelegramQueue

... to purge the queue and remove the scheduler.
This commit is contained in:
Christian Hesse 2023-08-06 16:26:22 +02:00
parent 0aeb34e5e9
commit c37739c2f6
2 changed files with 14 additions and 0 deletions

View file

@ -73,6 +73,11 @@ Place this before you call them:
:global SendTelegram;
:global SendNotification;
In case there is a situation when the queue needs to be purged there is a
function available:
$PurgeTelegramQueue;
Tips & Tricks
-------------

View file

@ -8,6 +8,7 @@
:global FlushTelegramQueue;
:global NotificationFunctions;
:global PurgeTelegramQueue;
:global SendTelegram;
:global SendTelegram2;
@ -162,6 +163,14 @@
}
}
# purge the Telegram queue
:set PurgeTelegramQueue do={
:global TelegramQueue;
/system/scheduler/remove [ find where name="\$FlushTelegramQueue" ];
:set TelegramQueue;
}
# send notification via telegram - expects at least two string arguments
:set SendTelegram do={
:global SendTelegram2;