deleteBusinessMessages()
Delete messages on behalf of a business account. 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. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
business_connection_id | string | required | Unique identifier of the business connection on behalf of which to delete the messages |
message_ids | number[] | required | A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted. |
returns
boolean
usage in yaebal
deleteBusinessMessages is directly typed on Api — call it straight off bot.api.
import type { DeleteBusinessMessagesParams } from "@yaebal/types";
await bot.api.deleteBusinessMessages({
business_connection_id: "...",
message_ids: [],
} satisfies DeleteBusinessMessagesParams);context shortcut
also available as ctx.deleteBusinessMessages() on
4
context types — see @yaebal/contexts.
/** Delete messages on behalf of a business account. 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. Returns *True* on success. */
ctx.deleteBusinessMessages(params: Omit<DeleteBusinessMessagesParams, "business_connection_id"> & { business_connection_id?: string })official Bot API docs: https://core.telegram.org/bots/api/#deletebusinessmessages