Layer 220
ChannelsDeleteMessages
Delete messages in a channel/supergroup
method
Users
Bots
channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;
Parameters
| Name | Type | Description |
|---|---|---|
| Channel | InputChannel | Channel/supergroup |
| Id | Vector<int> | IDs of messages to delete |
Returns
messages.AffectedMessagesPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 406 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 420 | FROZEN_METHOD_INVALID | The current account is frozen, and thus cannot execute the specified action. |
| 403 | MESSAGE_DELETE_FORBIDDEN | You can't delete one of the messages you tried to delete, most likely because it is a service message. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
Gogram Example
// ChannelsDeleteMessages - positional arguments result, err := client.ChannelsDeleteMessages(&tg.InputChannel{ChannelID: int64(123456789), AccessHash: int64(0)}, []int{}) if err != nil { // handle error } // result is *tg.MessagesAffectedMessages