messages.deleteMessages #

Deletes messages by their identifiers.

Layer 223

messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
---functions---
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
revokeflags.0?trueWhether to delete messages for all participants of the chat
idVector<int>Message ID list

Result #

messages.AffectedMessages

Both users and bots can use this method #

This method can be invoked over a business connection » #

Possible errors #

CodeTypeDescription
403BOT_ACCESS_FORBIDDENThe specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection.
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
403MESSAGE_DELETE_FORBIDDENYou can't delete one of the messages you tried to delete, most likely because it is a service message.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400SELF_DELETE_RESTRICTEDBusiness bots can't delete messages just for the user, revoke must be set.

Connected business bots #

Users can connect Telegram bots that will process and answer messages on their behalf. This allows them to seamlessly integrate any existing tools and workflows, or add AI assistants that manage their chats.

Telegram Business #

Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.