diff options
author | Christian Hesse <mail@eworm.de> | 2023-02-02 09:24:19 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-02-02 10:06:42 +0100 |
commit | 08383daa5c03f0621a59010bf86b5cea1b032471 (patch) | |
tree | 5577ce6db9f7d278ae57f747bf459fb1525bc26e /telegram-chat | |
parent | 2cb74f0269c7fbd342ee801b9478e4704448f349 (diff) |
telegram-chat: always reply to origin chat
Diffstat (limited to 'telegram-chat')
-rw-r--r-- | telegram-chat | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/telegram-chat b/telegram-chat index 317f030..f5b0f63 100644 --- a/telegram-chat +++ b/telegram-chat @@ -78,6 +78,7 @@ $WaitFullyConnected; :local From [ $JsonGetKey $Message "from" ]; :local FromID [ $JsonGetKey $From "id" ]; :local FromUserName [ $JsonGetKey $From "username" ]; + :local ChatID [ $JsonGetKey [ $JsonGetKey $Message "chat" ] "id" ]; :foreach IdsTrusted in=($TelegramChatId, $TelegramChatIdsTrusted) do={ :if ($FromID = $IdsTrusted || $FromUserName = $IdsTrusted) do={ :set Trusted true; @@ -109,13 +110,13 @@ $WaitFullyConnected; :set State "The command failed with an error!\n\n"; } :local Content [ /file/get ($File . ".txt") content ]; - $SendTelegram2 ({ origin=$0; silent=false; \ + $SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=("Command:\n" . $Text . "\n\n" . $State . [ $IfThenElse ([ :len $Content ] > 0) \ ("Output:\n" . $Content) "No output available." ]) }); /file/remove "tmpfs/telegram-chat"; } else={ - $SendTelegram2 ({ origin=$0; silent=false; \ + $SendTelegram2 ({ origin=$0; chatid=$ChatID; silent=false; \ subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \ message=("Command:\n" . $Text . "\n\nThe command failed syntax validation!") }); } |