unpinAllChatMessages()
Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. 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 channel in the format @username |
returns
boolean
usage in yaebal
unpinAllChatMessages is directly typed on Api — call it straight off bot.api.
import type { UnpinAllChatMessagesParams } from "@yaebal/types";
await bot.api.unpinAllChatMessages({
chat_id: 123456789,
} satisfies UnpinAllChatMessagesParams);context shortcut
also available as ctx.unpinAllChatMessages() on
17
context types — see @yaebal/contexts.
/** Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns *True* on success. */
ctx.unpinAllChatMessages(params?: Omit<UnpinAllChatMessagesParams, "chat_id">)official Bot API docs: https://core.telegram.org/bots/api/#unpinallchatmessages