Airgram

Guides
/
/
Methods

api.pinChatMessage()

Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel

Parameters PinChatMessageParams:

NameTypeDescription
chatIdnumber Identifier of the chat
messageIdnumber Identifier of the new pinned message
disableNotificationboolean True, if there must be no notification about the pinned message. Notifications are always disabled in channels and private chats
onlyForSelfboolean True, if the message needs to be pinned for one side only; private chats only
Returns ApiResponse interface:
interface ApiResponse {
  _: 'pinChatMessage' | 'error'
  airgram: Airgram
  request: {
    method: 'pinChatMessage'
    params: PinChatMessageParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}