Airgram

Guides
/
/
Methods

api.getChatSparseMessagePositions()

Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database

Parameters GetChatSparseMessagePositionsParams:

NameTypeDescription
chatIdnumber Identifier of the chat in which to return information about message positions
filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function
fromMessageIdnumber The message identifier from which to return information about message positions
limitnumber The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages
Returns ApiResponse interface:
interface ApiResponse {
  _: 'getChatSparseMessagePositions' | 'error'
  airgram: Airgram
  request: {
    method: 'getChatSparseMessagePositions'
    params: GetChatSparseMessagePositionsParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}