addChatMember

Add a single user to a chat.

Parameters

chatId: ID

The identifier of the chat to add the user to.

userId: ID

The identifier of the user to add to the chat.

historyLimit?: number

The number of current messages to make visible to the user that is about to be added.

Result

Syntax

// Required parameters only.
await client.addChatMember(chatId, userId);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.addChatMember(chatId, userId, { historyLimit });