Skip to content

pinChatMessage

Returns boolean

Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the ‘can_pin_messages’ right or the ‘can_edit_messages’ right to pin messages in groups and channels respectively.

Required: chat_id, message_id · Optional: 2 parameters

Try it
Token saved
Response

TypeScript example · @effect-ak/tg-bot-client
import { makeTgBotClient } from "@effect-ak/tg-bot-client"
const client = makeTgBotClient({ bot_token: "YOUR_BOT_TOKEN" })
const result = await client.execute("pin_chat_message", {
chat_id: "YOUR_CHAT_ID",
message_id: 0
})

Parameters

chat_id number | string Required
Unique identifier for the target chat or username of the target channel (in the format @channelusername).

message_id number Required
Identifier of a message to pin.

business_connection_id string
Unique identifier of the business connection on behalf of which the message will be pinned.

disable_notification boolean
Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.