deleteMessages()
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
chat_id | number | string | required | Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username |
message_ids | number[] | required | A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted. |
returns
boolean
usage in yaebal
deleteMessages is directly typed on Api — call it straight off bot.api.
import type { DeleteMessagesParams } from "@yaebal/types";
await bot.api.deleteMessages({
chat_id: 123456789,
message_ids: [],
} satisfies DeleteMessagesParams);context shortcut
also available as ctx.deleteMessages() on
17
context types — see @yaebal/contexts.
/** Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns *True* on success. */
ctx.deleteMessages(params: Omit<DeleteMessagesParams, "chat_id">)official Bot API docs: https://core.telegram.org/bots/api/#deletemessages