messages.deleteMessages

Deletes messages by their identifiers.

---functions---
messages.deleteMessages#14f2dd0a id:Vector<int> = Vector<int>;

Parameters

Name Type Description
flags # Flags, see TL conditional fields
revoke flags.0?true Whether to delete messages for all participants of the chat
id Vector<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

Code Type Description
403 BOT_ACCESS_FORBIDDEN The 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.
400 BUSINESS_CONNECTION_INVALID The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
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 MESSAGE_ID_INVALID The provided message id is invalid.
400 SELF_DELETE_RESTRICTED Business bots can't delete messages just for the user, revoke must be set.

Related pages

Connected business bots

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

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.