1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-02-05 13:25:25 +02:00

71 lines
1.7 KiB
Markdown
Raw Normal View History

---
sidebar_position: 1
---
# Send text message
Sends a text message to a chat or channel
2024-07-10 13:58:29 +03:00
`Function SendTextMessage(Val Token, Val ChatID, Val Text, Val Keyboard = "", Val Markup = "Markdown", Val RepliedID = 0) Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Token | --token | String | Bot token |
| ChatID | --chat | String, Number | Target chat ID or ChatID*TopicID |
| Text | --text | String | Message text |
| Keyboard | --keyboard | String | Keyboard JSON or path to .json |
| Markup | --parsemode | String | Text processing type (HTML, Markdown, MarkdownV2) |
| RepliedID | --reply | String, Number | Reply to message ID |
Returns: Map Of KeyAndValue - Serialized JSON response from Telegram
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-09-24 11:38:18 +03:00
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
ChannelID = "@testsichee";
Text = "Строковое значение";
2024-08-13 16:47:32 +03:00
Result = OPI_Telegram.SendTextMessage(Token, ChatID, Text);
Result = OPI_Telegram.SendTextMessage(Token, ChannelID, Text);
```
```sh title="CLI command example"
oint telegram SendTextMessage --token "6129457865:AAFyzNYOAFbu..." --chat "461699897" --text "String value" --keyboard %keyboard% --parsemode %parsemode% --reply %reply%
```
```json title="Result"
2024-08-14 09:06:31 +03:00
{
"ok": true,
"result": {
"message_id": 4638,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Vitaly The Bot",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titowets",
"username": "JKIee",
"type": "private"
},
"date": 1717072354,
"text": "String value"
}
}
```