# TdApi.GetChatMessageCount (tdlight API 4.0.311 API)
declaration: module: tdlight.api, package: it.tdlight.jni, class: TdApi, class: GetChatMessageCount

Module tdlight.api
Package it.tdlight.jni

# Class TdApi.GetChatMessageCount

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.Function<TdApi.Count>
it.tdlight.jni.TdApi.GetChatMessageCount

Enclosing class:
  TdApi

public static final class TdApi.GetChatMessageCount extends TdApi.Function<TdApi.Count>
Returns approximate number of messages of the specified type in the chat. Returns `Count`

## Field Summary

Fields
Modifier and Type
Field
Description
`long`
`chatId`
Identifier of the chat in which to count messages.
`static final int`
`CONSTRUCTOR`
`TdApi.SearchMessagesFilter`
`filter`
Filter for message content; searchMessagesFilterEmpty is unsupported in this function.
`boolean`
`returnLocal`
Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally.

## Constructor Summary

Constructors
Constructor
Description
`GetChatMessageCount()`
Returns approximate number of messages of the specified type in the chat.
`GetChatMessageCount(long chatId, TdApi.SearchMessagesFilter filter, boolean returnLocal)`
Returns approximate number of messages of the specified type in the chat.
`GetChatMessageCount(DataInput input)`
Returns approximate number of messages of the specified type in the chat.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`int`
`getConstructor()`
`int`
`hashCode()`
`void`
`serialize(DataOutput output)`

### Methods inherited from class it.tdlight.jni.TdApi.Function

`toString`

### Methods inherited from class it.tdlight.jni.TdApi.Object

`serialize`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### chatId

public long chatId
Identifier of the chat in which to count messages.

### filter

public TdApi.SearchMessagesFilter filter
Filter for message content; searchMessagesFilterEmpty is unsupported in this function.

### returnLocal

public boolean returnLocal
Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally.

### CONSTRUCTOR

public static final int CONSTRUCTOR

See Also:
  - Constant Field Values

## Constructor Details

### GetChatMessageCount

public GetChatMessageCount()
Returns approximate number of messages of the specified type in the chat. Returns `Count`

### GetChatMessageCount

public GetChatMessageCount(long chatId, TdApi.SearchMessagesFilter filter, boolean returnLocal)
Returns approximate number of messages of the specified type in the chat. Returns `Count`

Parameters:
  `chatId` - long Identifier of the chat in which to count messages.
  `filter` - SearchMessagesFilter Filter for message content; searchMessagesFilterEmpty is unsupported in this function.
  `returnLocal` - boolean Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally.

### GetChatMessageCount

public GetChatMessageCount(DataInput input) throws IOException
Returns approximate number of messages of the specified type in the chat. Returns `Count`

Throws:
  `IOException`

## Method Details

### getConstructor

public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`

### serialize

public void serialize(DataOutput output) throws IOException

Specified by:
  `serialize` in class `TdApi.Object`
Throws:
  `IOException`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`