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

Module tdlight.api
Package it.tdlight.jni

# Class TdApi.AddChatMember

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.Function<TdApi.Ok>
it.tdlight.jni.TdApi.AddChatMember

Enclosing class:
  TdApi

public static final class TdApi.AddChatMember extends TdApi.Function<TdApi.Ok>
Adds a new member to a chat. Members can't be added to private or secret chats. Returns `Ok`

## Field Summary

Fields
Modifier and Type
Field
Description
`long`
`chatId`
Chat identifier.
`static final int`
`CONSTRUCTOR`
`int`
`forwardLimit`
The number of earlier messages from the chat to be forwarded to the new member; up to 100.
`long`
`userId`
Identifier of the user.

## Constructor Summary

Constructors
Constructor
Description
`AddChatMember()`
Adds a new member to a chat.
`AddChatMember(long chatId, long userId, int forwardLimit)`
Adds a new member to a chat.
`AddChatMember(DataInput input)`
Adds a new member to a 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
Chat identifier.

### userId

public long userId
Identifier of the user.

### forwardLimit

public int forwardLimit
The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot.

### CONSTRUCTOR

public static final int CONSTRUCTOR

See Also:
  - Constant Field Values

## Constructor Details

### AddChatMember

public AddChatMember()
Adds a new member to a chat. Members can't be added to private or secret chats. Returns `Ok`

### AddChatMember

public AddChatMember(long chatId, long userId, int forwardLimit)
Adds a new member to a chat. Members can't be added to private or secret chats. Returns `Ok`

Parameters:
  `chatId` - long Chat identifier.
  `userId` - long Identifier of the user.
  `forwardLimit` - int The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot.

### AddChatMember

public AddChatMember(DataInput input) throws IOException
Adds a new member to a chat. Members can't be added to private or secret chats. Returns `Ok`

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`