delete_business_messages()

Client.delete_business_messages()

Delete messages on behalf of a business account.

Note

Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message.

Usable by Users Bots
Parameters:
  • business_connection_id (``str``) – Unique identifier of business connection on behalf of which to send the request.

  • message_ids (``int`` | Iterable of ``int``) – An iterable of message identifiers to delete (integers) or a single message id. All messages must be from the same chat.

Returns:

``int`` (Amount of affected messages)

Example

# Delete one message
await app.delete_business_messages(connection_id, message_id)

# Delete multiple messages at once
await app.delete_business_messages(connection_id, list_of_message_ids)