Documentation for Intellect 4.11.0-4.11.3. Documentation for other versions of Intellect is available too.

Previous page Examples of scripts with BacNet  Appendix 1. Description of the Editor-Debugger utility Next page


Sending a message to Telegram

On macro 1, send text, image or geolocation with Telegram bot.

if (Event.SourceType == "MACRO" && Event.SourceId == "1" && Event.Action == "RUN")
 
{
 
  //Sending with chat_id & bot_id from object settings:
 
  DoReactStr("TELEGRAM","1","SEND","text<Intellect works great>");
 
  //Explicit setting chat_id & bot_id in the command:
 
  DoReactStr("TELEGRAM","1","SEND","text<Intellect works great>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>");
 
  //Sending file with chat ID and bot ID:
 
  DoReactStr("TELEGRAM",1,"SENDPHOTO","caption<Intellect works great>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>,photo<G:\\1.jpg>");
 
  //Sending geolocation with chat ID and bot ID:
 
  DoReactStr("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>",longtitude<37.3428359>,latitude<55.6841654>,address<Office>);
 
}


  • No labels