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