2024-06-20 09:39:55 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 7
|
|
|
|
---
|
|
|
|
|
|
|
|
# Delete message
|
|
|
|
Delete message from chat or channel
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function DeleteMessage(Val Token, Val ChatID, Val MessageID) Export`
|
2024-06-20 09:39:55 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| ChatID | --chat | String, Number | Target chat ID |
|
|
|
|
| MessageID | --message | String, Number | ID of message to delete |
|
|
|
|
|
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Telegram
|
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-20 09:39:55 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-10 13:24:11 +02:00
|
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
2024-06-20 09:39:55 +02:00
|
|
|
ChatID = "@testsichee";
|
|
|
|
MessageID = "5385";
|
|
|
|
|
|
|
|
Result = OPI_Telegram.DeleteMessage(Token, ChatID, MessageID);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-20 09:39:55 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
2024-06-21 08:25:14 +02:00
|
|
|
oint telegram DeleteMessage --token "6129457865:AAFyzNYOAFbu..." --chat "@testsichee" --message "5385"
|
2024-06-20 09:39:55 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-06-20 09:39:55 +02:00
|
|
|
"ok": true,
|
|
|
|
"result": true
|
|
|
|
}
|
|
|
|
```
|