Advertisement
sopyanx

tg_sendMessage

Mar 24th, 2019
1,342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. :local fconfig [:parse [/system script get tg_config source]]
  2.  
  3. :local cfg [$fconfig]
  4. :local chatID ($cfg->"defaultChatID")
  5. :local botID ($cfg->"botAPI")
  6. :local storage ($cfg->"storage")
  7.  
  8. :if ([:len $chat]>0) do={:set chatID $chat}
  9.  
  10. :local url "https://api.telegram.org/bot$botID/sendmessage?chat_id=$chatID&text=$text"
  11. :if ([:len $mode]>0) do={:set url ($url."&parse_mode=$mode")}
  12.  
  13. :local file ($tgStorage."tg_get_updates.txt")
  14. :local logfile ($tgStorage."tg_fetch_log.txt")
  15.  
  16. /tool fetch url=$url keep-result=no
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement