Airgram

Guides
/
/
Methods

api.getChatMessageCount()

Returns approximate number of messages of the specified type in the chat

Parameters GetChatMessageCountParams:

NameTypeDescription
chatIdnumber Identifier of the chat in which to count messages
filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function
returnLocalboolean If true, returns count that is available locally without sending network requests, returning -1 if the number of messages is unknown
Returns ApiResponse interface:
interface ApiResponse {
  _: 'getChatMessageCount' | 'error'
  airgram: Airgram
  request: {
    method: 'getChatMessageCount'
    params: GetChatMessageCountParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}