Airgram

Guides
/
/
Methods

api.toggleChatIsPinned()

Changes the pinned state of a chat. There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/arhive chat list

Parameters ToggleChatIsPinnedParams:

NameTypeDescription
chatList Chat list in which to change the pinned state of the chat
chatIdnumber Chat identifier
isPinnedboolean True, if the chat is pinned
Returns ApiResponse interface:
interface ApiResponse {
  _: 'toggleChatIsPinned' | 'error'
  airgram: Airgram
  request: {
    method: 'toggleChatIsPinned'
    params: ToggleChatIsPinnedParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}