banChatMember

Ban a member from a chat.

Parameters

chatId: ID

The identifier of the chat.

memberId: ID

The identifier of the member.

untilDate?: Date

A point in time within the future in which the ban will be reverted.

deleteMessages?: boolean

Whether to delete all of the user’s messages.

Result

void

Syntax

// Required parameters only.
await client.banChatMember(chatId, memberId);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.banChatMember(chatId, memberId, { untilDate, deleteMessages });