channels.deleteMessages #

Delete messages in a channel/supergroup

Layer 223

messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
---functions---
channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;

Parameters #

NameTypeDescription
channelInputChannelChannel/supergroup
idVector<int>IDs of messages to delete

Result #

messages.AffectedMessages

Both users and bots can use this method #

Possible errors #

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
406CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
420FROZEN_METHOD_INVALIDThe current account is frozen, and thus cannot execute the specified action.
403MESSAGE_DELETE_FORBIDDENYou can't delete one of the messages you tried to delete, most likely because it is a service message.
400MSG_ID_INVALIDInvalid message ID provided.

Channels, supergroups, gigagroups and basic groups #

How to handle channels, supergroups, gigagroups, basic groups, and what's the difference between them.

User Authorization #

How to register a user's phone to start using the API.