Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Next page


You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The TELEGRAM object corresponds to the Telegram bot system object.

The TELEGRAM object sends events presented in the table.  Procedure is started when the corresponding event appears.

OnEvent("TELEGRAM","_id_","_event_")

Event

Description

Comment

ERROR

Error of message sending.

The error<> parameter contains the test description of the error.

Format of operator to describe actions with mail message is following:

DoReact("TELEGRAM","_id_","_command_" [,"_parameters_"]);

List of commands and parameters for the TELEGRAM object is given in the table:

Commandcommand description

Parameters

Description

"SEND" – send mail message.

text<>

Message text

chat_id<>Chat identifier
bot_id<>Bot identifier
"SEND_RAW" – send e-mail with parametersphoto<>Full path to the image file
caption<>Text comment to the file
chat_id<>Chat identifier
bot_id<>Bot identifier


Examples of calling the command for sending a message to Telegram by macro:

OnEvent("MACRO","3","RUN") //run macro 3
{
 //Sending with chat_id & bot_id from object settings:
 DoReact("TELEGRAM",1,"SEND","text<Hello world>");
 
 //Setting chat_id & bot_id in the command:
 DoReact("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>");
 
 //Sending image file with explicit chat ID and bot ID setting:
 DoReact("TELEGRAM",1,"SENDPHOTO","caption<Hello world>,chat_id<828752651>,bot_id<809045046:AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>,photo<G:\\1.jpg>");
}


  • No labels