Package org.bgerp.plugin.telegram
Class ExpressionObject
java.lang.Object
org.bgerp.plugin.telegram.ExpressionObject
- All Implemented Interfaces:
ExpressionObject
Telegram JEXL API for sending messages to chats.
Generic method
sendMessage(Collection, String, String) sends message in different formats to chat ID.
There are three formats available, more about those: https://core.telegram.org/bots/api#formatting-options
Chat IDs for sending can be a also stored in user or process text parameter with ID configured as telegram:userParamId or telegram:processParamId respectively.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeMarkdown(String text) Escape a Markdown text fromSPECIAL_CHARACTERS_MDvoidsendMessage(String chatId, String text) Send a plain text message to a chatvoidsendMessage(String chatId, String text, String parseMode) Send a message to a chat with a specific formatvoidsendMessage(Collection<Integer> userIds, String text) Send a plain text message to usersvoidsendMessage(Collection<Integer> userIds, String text, String parseMode) Send a message with a specific format to usersvoidsendMessage(Process process, String text) Send a plain text message to a process executorsvoidsendMessage(Process process, String text, String parseMode) Send a message with a specific format to a process executorsvoidsendMessageForProcess(Process process, String text) Send a plain text message to a processvoid
-
Constructor Details
-
ExpressionObject
public ExpressionObject()Public constructor, can be used in Custom
-
-
Method Details
-
escapeMarkdown
Escape a Markdown text fromSPECIAL_CHARACTERS_MD- Parameters:
text- the Markdown text- Returns:
- the
textwith escaped special characters
-
toContext
- Specified by:
toContextin interfaceExpressionObject
-
sendMessage
Send a plain text message to a chat- Parameters:
chatId- the chat IDtext- the message
-
sendMessage
Send a message to a chat with a specific format- Parameters:
chatId- the chat IDtext- the messageparseMode- the format:null- plain text,MarkdownV2,HTML
-
sendMessage
Send a plain text message to users- Parameters:
userIds- the user IDstext- the message
-
sendMessage
Send a message with a specific format to users- Parameters:
userIds- the user IDstext- the messageparseMode- the format:null- plain text,MarkdownV2,HTML
-
sendMessage
Send a plain text message to a process executors- Parameters:
process- the process with the executor user IDstext- the message
-
sendMessage
Send a message with a specific format to a process executors- Parameters:
process- the process with the executor user IDstext- the messageparseMode- the format:null- plain text,MarkdownV2,HTML
-
sendMessageForProcess
Send a plain text message to a process- Parameters:
process- the processtext- the message
-