Skip to main content

Send text message

Sends a text message to a chat or channel

Function SendTextMessage(Val Token, Val ChatID, Val Text, Val Keyboard = "", Val Markup = "Markdown", Val RepliedID = 0) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
ChatID--chatString, NumberTarget chat ID or ChatID*TopicID
Text--textStringMessage text
Keyboard--keyboardStringKeyboard. See FormKeyboardFromButtonArray
Markup--parsemodeStringText processing type (HTML, Markdown, MarkdownV2)
RepliedID--replyString, NumberReply to message ID

Returns: Map Of KeyAndValue - serialized JSON response from Telegram


tip

Method at API documentation: sendMessage


1C:Enterprise/OneScript code example
    Token     = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
ChannelID = "@testsichee";
Text = "Строковое значение";

Result = OPI_Telegram.SendTextMessage(Token, ChatID, Text);

Result = OPI_Telegram.SendTextMessage(Token, ChannelID, Text);
    oint telegram SendTextMessage \
--token "***" \
--chat "@testsichee" \
--text "Text %%F0%%9F%%A5%%9D and emoji \(10%%\)" \
--parsemode "MarkdownV2"
Result
{
"ok": true,
"result": {
"message_id": 8302,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titowets",
"username": "JKIee",
"type": "private"
},
"date": 1728453289,
"text": "Строковое значение"
}
}