telegram-chat: support debug output for updates in JSON

This commit is contained in:
Christian Hesse 2025-05-13 09:52:12 +02:00
parent 1b5dd1e1d3
commit f1396b83aa

View file

@ -33,6 +33,7 @@
:global GetRandom20CharAlNum;
:global IfThenElse;
:global LogPrint;
:global LogPrintVerbose;
:global MAX;
:global MIN;
:global MkDir;
@ -96,6 +97,8 @@
:local Uptime [ /system/resource/get uptime ];
:foreach Update in=($JSON->"result") do={
:set UpdateID ($Update->"update_id");
$LogPrintVerbose debug $ScriptName ("Update " . $UpdateID . ": " . [ :serialize to=json $Update ]);
:local Message ($Update->"message");
:local IsReply ([ :typeof ($Message->"reply_to_message") ] = "string");
:local IsMyReply ($TelegramMessageIDs->[ :tostr ($Message->"reply_to_message"->"message_id") ]);