Community discussions

MikroTik App
 
User avatar
Sertik
Member
Member
Topic Author
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Laurent Telegram Terminal

Fri Dec 23, 2022 1:26 pm

I wrote a Terminal for Telegram that works in RouterOS and allows you to control the firmware API module from the user's chatbot.
Laurent Telegram Terminal uses JSON parser for Router OS https://github.com/Winand/mikrotik-json-parser

Laurent 5G has over 100 firmware api commands, but not all of them are needed to be executed from the chatbot. Those api commands that we allow to execute must be entered in the arrayCom array. You can edit it however you like. LTT user settings must also be set before operation.

Here's Laurent Telegram Terminal (LTT) codе (the code is far from ideal, but it works and is being improved):

# LTT by Sertik 28/11/2022
# ----------------------------------------------------------------------------------------------
# http://<IP_address/cmd.cgi?psw=<Laurent`s password>&cmd=<KeCommands>
# http://<IP_address>/<Name json file>[?psw=<Laurent`s_pasword>]
#----------------------------------------------------------------------------------------------

#LTT settings:
:local Emoji "%F0%9F%A7%9A"
:local Esys "$Emoji$[/system identity get name]%0A"
:local TToken "XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
:local TChatId "YYYYYYYYY"
:local Ladr 192.168.0.1
:local Sport 80
:local PSW "Laurent"

# allowed $KE commands:
:local arrayCom [:toarray {"REL"="set on/off/switch rele";
                                      "RDR"="rele status";
                                      "INF"="information Laurent-5G board";
                                      "GST"="modem status";
                                      "SMS"="send SMS";
                                      "PSW"="read module password";
                                      "SEC"="security policy";
                                      "RID"="read status OUT line";
                                      "SENSOR"="get sensors status Laurent";
                                      "SETTINGS"="get sensors status Laurent";
                                       "WR"="set on/off/switch OUT line"}]

# sub-function of replacing a space with a comma in a line
:local SpaceComChar do={:local string; :set $string $1;
:local StrTele ""; :local code "";
:for i from=0 to=([:len $string]-1) do={:local keys [:pick $string $i (1+$i)];; if ($keys=" ") do={:set $code ","} else={:set $code $keys}; :set $StrTele ("$StrTele"."$code")}
:return $StrTele;}

#main body script
/system script run JParseFunctions
:global Toffset
:if ([:typeof $Toffset] != "num") do={:set Toffset 0}
do {
:global JSONIn [/tool fetch url="https://api.telegram.org/bot$TToken/getUpdates\?chat_id=$TChatId&offset=$Toffset" as-value output=user]; :set JSONIn ($JSONIn->"data")
} on-error={:set $JSONIn []}
:global fJParse
:global JParseOut [$fJParse]
:local Results ($JParseOut->"result")

# -----------------
:if ([:len $Results]>0) do={
:local TXT
  :foreach k,v in=$Results do={
    :if (any ($v->"message"->"text")) do={
     :local cmd ($v->"message"->"text")
     :local cmdR 
:if ([:len [:find $cmd " "]]=0) do={:set cmdR $cmd} else={:set cmdR [:pick $cmd 0 [:find $cmd " "]]}
      :local prefix "/"
      :local cmdrun 0

# executing special commands "list" (output commands to chat)
 :if ($cmdrun=0) do={
  :if (($cmd="list") or ($cmd=$prefix."list")) do={
  :local cmdlist; :foreach t,n in=$arrayCom do={:set $cmdlist ("$cmdlist"."/$t "."- "."$n"."\n")}
   /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId"  \
    http-method=post  http-data="text=$Emoji $[/system identity get name] Laurent terminal commands:%0A$cmdlist" keep-result=no; set cmdrun 1
 }
}

# executing special commands for read JSON data
 :if ($cmdrun=0) do={
    :local fetS 
  :if (($cmdR="SENSOR") or ($cmdR=$prefix."SENSOR")) do={:set fetS "sensor"}
  :if (($cmdR="SETTINGS") or ($cmdR=$prefix."SETTINGS")) do={:set fetS "set"}
         :if ([:len $fetS]!=0) do={
                          :local StrFetchLaurent; :local Lanswer; 
                          :set StrFetchLaurent ("http://"."$Ladr".":"."$Sport"."/json_"."$fetS".".cgi\?psw=$PSW")
                         :do {
                          :set Lanswer [/tool fetch url=$StrFetchLaurent as-value output=user]
                          } on-error={:set TXT "ERROR call to Laurent 5G module"; log error $TXT; :set $JSONIn []}
                          :global JSONLoads;
            :if ($cmd!=$cmdR) do={
                         :local WLanswer [$JSONLoads ($Lanswer->"data")]
                         :local cmdX [:pick $cmd ([:find $cmd " "]+1) [:len $cmd]]; :set $cmdR $cmdX; :set Lanswer [:tostr ($WLanswer->$cmdX)];} else={:set Lanswer ($Lanswer->"data")}
   /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId"  \
    http-method=post  http-data="text=$Emoji $[/system identity get name] Laurent status [$cmdR]:%0A $Lanswer" keep-result=no; set cmdrun 1
 }
}


# executing commands from a list arrayCom
   :if ($cmdrun=0) do={   
        :foreach key,val in=$arrayCom do={
              :if (($cmdR=$key) or ($cmdR=$prefix.$key)) do={
                      :set cmd [$SpaceComChar $cmd]; 
                         if ($cmdR=$prefix.$key) do={:set cmd [:pick $cmd ([:find $cmd $prefix]+1) [:len $cmd]]}
                          :local StrFetchLaurent; :local Lanswer; 
                          :set StrFetchLaurent ("http://"."$Ladr".":"."$Sport"."/cmd.cgi\?psw=$PSW&cmd=$cmd")
                         :do {
                          :set Lanswer [/tool fetch url=$StrFetchLaurent as-value output=user]
                          } on-error={:set TXT "ERROR call to Laurent 5G module"; log error $TXT;}
                                  :set Lanswer ($Lanswer->"data")                     
                                  :set cmdrun 1;
                                 :set TXT ("Executing Laurent command in progress <- $cmd -> %0A Module answer $Lanswer")
                                /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId" \
                                 http-method=post  http-data="text=$Esys $TXT" keep-result=no;
              }
       }
 }

    :set $Toffset ($v->"update_id" + 1)}
  }  
} else={ 
  :set $Toffset 0;
}
Here is a simplified version of LTT. There is an extended version that includes additional features.
Last edited by Sertik on Sat Dec 24, 2022 5:30 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Laurent Telegram Terminal

Sat Dec 24, 2022 4:25 am

arrayCom is already defined as array, [:toarray ] is useless

and allineated code is better readable for all

example code

#LTT settings:
:local Emoji   "%F0%9F%A7%9A"
:local Esys    "$Emoji$[/system identity get name]%0A"
:local TToken  "XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
:local TChatId "YYYYYYYYY"
:local Ladr    192.168.0.1
:local Sport   80
:local PSW     "Laurent"

# allowed $KE commands:
:local arrayCom {"REL"="set on/off/switch rele";
                 "RDR"="rele status";
                 "INF"="information Laurent-5G board";
                 "GST"="modem status";
                 "SMS"="send SMS";
                 "PSW"="read module password";
                 "SEC"="security policy";
                 "RID"="read status OUT line";
                 "SENSOR"="get sensors status Laurent";
                 "SETTINGS"="get sensors status Laurent";
                 "WR"="set on/off/switch OUT line"
}

Improved version of SpaceComChar (also on previous version ";; if" must be replaced with "; :if")
:local SpaceComChar do={:local ret  ""
                        :local char ""
                        :for i from=0 to=([:len $1] - 1) do={
                            :set char [:pick $1 $i ($i + 1)]
                            :if ($char = " ") do={:set $char ","}
                            :set ret "$ret$char"
                        }
                        :return $ret
}

} on-error={:set $JSONIn []}
must be replaced with
} on-error={:set JSONIn []}

:set $cmdlist ("$cmdlist"."/$t "."- "."$n"."\n")
must be replaced with
:set $cmdlist "$cmdlist/$t - $n\n"
without $ and removing useless ("".""."".""."")

This is present 2 times: "; set cmdrun 1" must be "; :set cmdrun 1" on both lines

:set StrFetchLaurent ("http://"."$Ladr".":"."$Sport"."/json_"."$fetS".".cgi\?psw=$PSW")
can be replaced with
:set StrFetchLaurent "http://$Ladr:$Sport/json_$fetS.cgi\?psw=$PSW"

"; log error $TXT; :set $JSONIn []"
must be replaced with
"; :log error $TXT; :set JSONIn []"

:set $cmdR $cmdX;
must be replaced with
:set cmdR $cmdX;

missing : before
if ($cmdR=$prefix.$key)

:set StrFetchLaurent ("http://"."$Ladr".":"."$Sport"."/cmd.cgi\?psw=$PSW&cmd=$cmd")
can be replaced with
:set StrFetchLaurent "http://$Ladr:$Sport/cmd.cgi\?psw=$PSW&cmd=$cmd"

"; log error $TXT"
must be replaced with
"; :log error $TXT"

:set $Toffset ($v->"update_id" + 1)}
must be replaced with
:set Toffset ($v->"update_id" + 1)}

:set $Toffset 0;
must be replaced with
:set Toffset 0;
Last edited by rextended on Sun Dec 25, 2022 12:22 pm, edited 1 time in total.
 
User avatar
Sertik
Member
Member
Topic Author
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: Laurent Telegram Terminal

Sat Dec 24, 2022 4:47 pm

Thanks Rex. I will correct the code with your comments.

} on-error={:set $JSONIn []}
must be replaced with
} on-error={:set JSONIn []}

I put $ in assignments of this kind, because RouterOS terminal does not understand variable setting without $.
 
User avatar
Sertik
Member
Member
Topic Author
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: Laurent Telegram Terminal

Sat Dec 24, 2022 5:21 pm

Corrected code taking into account REX comments:

# LTT by Sertik 24/12/2022
# ----------------------------------------------------------------------------------------------
# http://<IP_address/cmd.cgi?psw=<Laurent`s password>&cmd=<KeCommands>
# http://<IP_address>/<Name json file>[?psw=<Laurent`s_pasword>]
#----------------------------------------------------------------------------------------------

#LTT settings:
:local Emoji "%F0%9F%A7%9A"
:local Esys "$Emoji$[/system identity get name]%0A"
:local TToken "XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
:local TChatId "YYYYYYYYY"
:local Ladr 192.168.0.1
:local Sport 80
:local PSW "Laurent"

# allowed $KE commands:
:local arrayCom {"REL"="set on/off/switch rele";
                                 "RDR"="rele status";
                                 "INF"="information Laurent-5G board";
                                 "GST"="modem status";
                                 "SMS"="send SMS";
                                 "PSW"="read module password";
                                 "SEC"="security policy";
                                 "RID"="read status OUT line";
                                 "SENSOR"="get sensors status Laurent";
                                 "SETTINGS"="get sensors status Laurent";
                                 "WR"="set on/off/switch OUT line"}

# sub-function of replacing a space with a comma in a line
:local SpaceComChar do={:local ret  ""
                        :local char ""
                        :for i from=0 to=([:len $1] - 1) do={
                            :set char [:pick $1 $i ($i + 1)]
                            :if ($char = " ") do={:set $char ","}
                            :set $ret "$ret$char"
                        }
                        :return $ret
}

#main body script
/system script run JParseFunctions
:global Toffset
:if ([:typeof $Toffset] != "num") do={:set Toffset 0}
do {
:global JSONIn [/tool fetch url="https://api.telegram.org/bot$TToken/getUpdates\?chat_id=$TChatId&offset=$Toffset" as-value output=user]; :set JSONIn ($JSONIn->"data")
} on-error={:set JSONIn []}
:global fJParse
:global JParseOut [$fJParse]
:local Results ($JParseOut->"result")

# -----------------
:if ([:len $Results]>0) do={
:local TXT
  :foreach k,v in=$Results do={
    :if (any ($v->"message"->"text")) do={
     :local cmd ($v->"message"->"text")
     :local cmdR 
:if ([:len [:find $cmd " "]]=0) do={:set cmdR $cmd} else={:set cmdR [:pick $cmd 0 [:find $cmd " "]]}
      :local prefix "/"
      :local cmdrun 0

# executing special commands "list" (output commands to chat)
 :if ($cmdrun=0) do={
  :if (($cmd="list") or ($cmd=$prefix."list")) do={
  :local cmdlist; :foreach t,n in=$arrayCom do={:set cmdlist "$cmdlist/$t - $n\n"}
   /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId"  \
    http-method=post  http-data="text=$Emoji $[/system identity get name] Laurent terminal commands:%0A$cmdlist" keep-result=no; :set cmdrun 1
 }
}

# executing special commands for read JSON data
 :if ($cmdrun=0) do={
    :local fetS 
  :if (($cmdR="SENSOR") or ($cmdR=$prefix."SENSOR")) do={:set fetS "sensor"}
  :if (($cmdR="SETTINGS") or ($cmdR=$prefix."SETTINGS")) do={:set fetS "set"}
         :if ([:len $fetS]!=0) do={
                          :local StrFetchLaurent; :local Lanswer; 
	     :set StrFetchLaurent "http://$Ladr:$Sport/json_$fetS.cgi\?psw=$PSW"
                         :do {
                          :set Lanswer [/tool fetch url=$StrFetchLaurent as-value output=user]
                          } on-error={:set TXT "ERROR call to Laurent 5G module"; :log error $TXT; :set JSONIn []}
                          :global JSONLoads;
            :if ($cmd!=$cmdR) do={
                         :local WLanswer [$JSONLoads ($Lanswer->"data")]
                         :local cmdX [:pick $cmd ([:find $cmd " "]+1) [:len $cmd]]; :set cmdR $cmdX; :set Lanswer [:tostr ($WLanswer->$cmdX)];} else={:set Lanswer ($Lanswer->"data")}
   /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId"  \
    http-method=post  http-data="text=$Emoji $[/system identity get name] Laurent status [$cmdR]:%0A $Lanswer" keep-result=no; :set cmdrun 1
 }
}


# executing commands from a list arrayCom
   :if ($cmdrun=0) do={   
        :foreach key,val in=$arrayCom do={
              :if (($cmdR=$key) or ($cmdR=$prefix.$key)) do={
                      :set cmd [$SpaceComChar $cmd]; 
                         if ($cmdR=$prefix.$key) do={:set cmd [:pick $cmd ([:find $cmd $prefix]+1) [:len $cmd]]}
                          :local StrFetchLaurent; :local Lanswer; 
	     :set StrFetchLaurent "http://$Ladr:$Sport/cmd.cgi\?psw=$PSW&cmd=$cmd"
                         :do {
                          :set Lanswer [/tool fetch url=$StrFetchLaurent as-value output=user]
                          } on-error={:set TXT "ERROR call to Laurent 5G module"; :log error $TXT;}
                                  :set Lanswer ($Lanswer->"data")                     
                                  :set cmdrun 1;
                                 :set TXT ("Executing Laurent command in progress <- $cmd -> %0A Module answer $Lanswer")
                                /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId" \
                                 http-method=post  http-data="text=$Esys $TXT" keep-result=no;
              }
       }
 }

    :set Toffset ($v->"update_id" + 1)}
  }  
} else={ 
  :set Toffset 0;
}

Let me remind you that this is a simple version of the Terminal for Laurent. There is an advanced version with more features. If there is interest I will post it. Currently, work is underway to create not a "terminal", but a graphical version of the chatbot.
 
User avatar
Sertik
Member
Member
Topic Author
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: Laurent Telegram Terminal

Sun Dec 25, 2022 12:22 pm

By the way, REX, why prefix the ROS commands at the beginning of the line with the ":" symbol if everything works without it?

For example:
:log info "Hello Rex !"

log info "Hello Sertik !"
Last edited by Sertik on Sun Dec 25, 2022 12:27 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Laurent Telegram Terminal

Sun Dec 25, 2022 12:25 pm

Replace
:set $ret "$ret$char"
with
:set ret "$ret$char"
no one will be immune of error on own writed scripts...

because the ":" specify that the function must be taken from the global root,
if you omit that and previously you change root with someting lile "/system script" no longer work anything as intended after that command,
becaose routeros srcript interpret "log" without : as "/system script log" that do not exist.
The same for :if, :foreach, :do, etc.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Laurent Telegram Terminal

Sun Dec 25, 2022 12:31 pm

Thanks Rex. I will correct the code with your comments.

} on-error={:set $JSONIn []}
must be replaced with
} on-error={:set JSONIn []}

I put $ in assignments of this kind, because RouterOS terminal does not understand variable setting without $.
I fix only syntax error, not logic errors.

This is wrong:

ex code

[...]
do {
:global JSONIn [/tool fetch ...]; :set JSONIn ($JSONIn->"data")
} on-error={:set $JSONIn []}
[...]
                         :do {
[...]
                          } on-error={ [...] ; :set $JSONIn []}
[...]

This is wrong because JSONIn must be defined before, and the error syntax make to not evidence that...
The correct way is this:

corrected code

:global JSONIn
[...]
do {
:set JSONIn [/tool fetch ...]; :set JSONIn ($JSONIn->"data")
} on-error={:set JSONIn [] }
[...]
                         :do {
[...]
                          } on-error={ [...] ; :set JSONIn [] }
[...]
 
User avatar
Sertik
Member
Member
Topic Author
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: Laurent Telegram Terminal

Sun Dec 25, 2022 12:39 pm

Yes, I absolutely agree with this. I know this, in the code is my cant. I'll fix it.
# LTT by Sertik 24/12/2022
# ----------------------------------------------------------------------------------------------
# http://<IP_address/cmd.cgi?psw=<Laurent`s password>&cmd=<KeCommands>
# http://<IP_address>/<Name json file>[?psw=<Laurent`s_pasword>]
#----------------------------------------------------------------------------------------------

#LTT settings:
:local Emoji "%F0%9F%A7%9A"
:local Esys "$Emoji$[/system identity get name]%0A"
:local TToken "XXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
:local TChatId "YYYYYYYYY"
:local Ladr 192.168.0.1
:local Sport 80
:local PSW "Laurent"

# allowed $KE commands:
:local arrayCom {	"REL"="set on/off/switch rele";
			"RDR"="rele status";
			"INF"="information Laurent-5G board";
			"GST"="modem status";
			"SMS"="send SMS";
			"PSW"="read module password";
			"SEC"="security policy";
			"RID"="read status OUT line";
			"SENSOR"="get sensors status Laurent";
			"SETTINGS"="get sensors status Laurent";
			"WR"="set on/off/switch OUT line"}

# sub-function of replacing a space with a comma in a line
:local SpaceComChar do={:local ret  ""
                        :local char ""
                        :for i from=0 to=([:len $1] - 1) do={
                            :set char [:pick $1 $i ($i + 1)]
                            :if ($char = " ") do={:set $char ","}
                            :set $ret "$ret$char"
                        }
                        :return $ret
}

#main body script
/system script run JParseFunctions
:global Toffset
:global JSONIn
:if ([:typeof $Toffset] != "num") do={:set Toffset 0}
do {
:set JSONIn [/tool fetch url="https://api.telegram.org/bot$TToken/getUpdates\?chat_id=$TChatId&offset=$Toffset" as-value output=user]; :set JSONIn ($JSONIn->"data")
} on-error={:set JSONIn []}
:global fJParse
:global JParseOut [$fJParse]
:local Results ($JParseOut->"result")

# -----------------
:if ([:len $Results]>0) do={
:local TXT
  :foreach k,v in=$Results do={
    :if (any ($v->"message"->"text")) do={
     :local cmd ($v->"message"->"text")
     :local cmdR 
:if ([:len [:find $cmd " "]]=0) do={:set cmdR $cmd} else={:set cmdR [:pick $cmd 0 [:find $cmd " "]]}
      :local prefix "/"
      :local cmdrun 0

# executing special commands "list" (output commands to chat)
 :if ($cmdrun=0) do={
  :if (($cmd="list") or ($cmd=$prefix."list")) do={
  :local cmdlist; :foreach t,n in=$arrayCom do={:set cmdlist "$cmdlist/$t - $n\n"}
   /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId"  \
    http-method=post  http-data="text=$Emoji $[/system identity get name] Laurent terminal commands:%0A$cmdlist" keep-result=no; :set cmdrun 1
 }
}

# executing special commands for read JSON data
 :if ($cmdrun=0) do={
    :local fetS 
  :if (($cmdR="SENSOR") or ($cmdR=$prefix."SENSOR")) do={:set fetS "sensor"}
  :if (($cmdR="SETTINGS") or ($cmdR=$prefix."SETTINGS")) do={:set fetS "set"}
         :if ([:len $fetS]!=0) do={
                          :local StrFetchLaurent; :local Lanswer; 
	     :set StrFetchLaurent "http://$Ladr:$Sport/json_$fetS.cgi\?psw=$PSW"
                         :do {
                          :set Lanswer [/tool fetch url=$StrFetchLaurent as-value output=user]
                          } on-error={:set TXT "ERROR call to Laurent 5G module"; :log error $TXT; :set JSONIn []}
                          :global JSONLoads;
            :if ($cmd!=$cmdR) do={
                         :local WLanswer [$JSONLoads ($Lanswer->"data")]
                         :local cmdX [:pick $cmd ([:find $cmd " "]+1) [:len $cmd]]; :set cmdR $cmdX; :set Lanswer [:tostr ($WLanswer->$cmdX)];} else={:set Lanswer ($Lanswer->"data")}
                :do {         
   		/tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId"  \
    		http-method=post  http-data="text=$Emoji $[/system identity get name] Laurent status [$cmdR]:%0A $Lanswer" keep-result=no;
    		on-error={:log error "Сhat output error"}
    :set cmdrun 1
 }
}


# executing commands from a list arrayCom
   :if ($cmdrun=0) do={   
        :foreach key,val in=$arrayCom do={
              :if (($cmdR=$key) or ($cmdR=$prefix.$key)) do={
                      :set cmd [$SpaceComChar $cmd]; 
                         if ($cmdR=$prefix.$key) do={:set cmd [:pick $cmd ([:find $cmd $prefix]+1) [:len $cmd]]}
                          :local StrFetchLaurent; :local Lanswer; 
	     :set StrFetchLaurent "http://$Ladr:$Sport/cmd.cgi\?psw=$PSW&cmd=$cmd"
                         :do {
                          :set Lanswer [/tool fetch url=$StrFetchLaurent as-value output=user]
                          } on-error={:set TXT "ERROR call to Laurent 5G module"; :log error $TXT;}
                                  :set Lanswer ($Lanswer->"data")                     
                                  :set cmdrun 1;
                                 :set TXT ("Executing Laurent command in progress <- $cmd -> %0A Module answer $Lanswer")
                                 :do {
                                /tool fetch url="https://api.telegram.org/bot$TToken/sendmessage\?chat_id=$TChatId" \
                                 http-method=post  http-data="text=$Esys $TXT" keep-result=no;
                                 on-error={:log error "Сhat output error"}
              }
       }
 }

    :set Toffset ($v->"update_id" + 1)}
  }  
} else={ 
  :set Toffset 0;
}
 
User avatar
Sertik
Member
Member
Topic Author
Posts: 435
Joined: Fri Sep 25, 2020 3:30 pm
Location: Russia, Moscow

Re: Laurent Telegram Terminal

Tue Sep 19, 2023 1:59 pm

Who is online

Users browsing this forum: No registered users and 16 guests