Delete messages on behalf of a business account. Requires the :attr:`~telegram.BusinessBotRights.can_delete_sent_messages` business bot right to delete messages sent by the bot itself, or the :attr:`~telegram.BusinessBotRights.can_delete_all_messages` business bot ri
(
self,
business_connection_id: str,
message_ids: Sequence[int],
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
connect_timeout: ODVInput[float] = DEFAULT_NONE,
pool_timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict | None = None,
)
| 9853 | ) |
| 9854 | |
| 9855 | async def delete_business_messages( |
| 9856 | self, |
| 9857 | business_connection_id: str, |
| 9858 | message_ids: Sequence[int], |
| 9859 | *, |
| 9860 | read_timeout: ODVInput[float] = DEFAULT_NONE, |
| 9861 | write_timeout: ODVInput[float] = DEFAULT_NONE, |
| 9862 | connect_timeout: ODVInput[float] = DEFAULT_NONE, |
| 9863 | pool_timeout: ODVInput[float] = DEFAULT_NONE, |
| 9864 | api_kwargs: JSONDict | None = None, |
| 9865 | ) -> bool: |
| 9866 | """ |
| 9867 | Delete messages on behalf of a business account. Requires the |
| 9868 | :attr:`~telegram.BusinessBotRights.can_delete_sent_messages` business bot right to |
| 9869 | delete messages sent by the bot itself, or the |
| 9870 | :attr:`~telegram.BusinessBotRights.can_delete_all_messages` business bot right to delete |
| 9871 | any message. |
| 9872 | |
| 9873 | .. versionadded:: 22.1 |
| 9874 | |
| 9875 | Args: |
| 9876 | business_connection_id (:obj:`int` | :obj:`str`): Unique identifier of the business |
| 9877 | connection on behalf of which to delete the messages |
| 9878 | message_ids (Sequence[:obj:`int`]): A list of |
| 9879 | :tg-const:`telegram.constants.BulkRequestLimit.MIN_LIMIT`- |
| 9880 | :tg-const:`telegram.constants.BulkRequestLimit.MAX_LIMIT` identifiers of messages |
| 9881 | to delete. See :meth:`delete_message` for limitations on which messages can be |
| 9882 | deleted. |
| 9883 | |
| 9884 | Returns: |
| 9885 | :obj:`bool`: On success, :obj:`True` is returned. |
| 9886 | """ |
| 9887 | data: JSONDict = { |
| 9888 | "business_connection_id": business_connection_id, |
| 9889 | "message_ids": message_ids, |
| 9890 | } |
| 9891 | return await self._post( |
| 9892 | "deleteBusinessMessages", |
| 9893 | data, |
| 9894 | read_timeout=read_timeout, |
| 9895 | write_timeout=write_timeout, |
| 9896 | connect_timeout=connect_timeout, |
| 9897 | pool_timeout=pool_timeout, |
| 9898 | api_kwargs=api_kwargs, |
| 9899 | ) |
| 9900 | |
| 9901 | async def post_story( |
| 9902 | self, |