Chat
classA chat: private conversation, group, supergroup, or channel.
Declaration
declare class Chat extends Base<T.Chat> Properties
Methods
banMember(userId: number, options?: Without$1<BanChatMemberParams, 'user_id'>): Promise<boolean>;| Parameter | Type |
|---|---|
| userId | number |
| options? | Without$1<BanChatMemberParams, 'user_id'> |
Returns Promise<boolean>
Ban a user from this chat.
fetchMember(userId: number): Promise<ChatMember>;| Parameter | Type |
|---|---|
| userId | number |
Returns Promise<ChatMember>
Fetch a member of this chat.
fetchMemberCount(): Promise<number>;Returns Promise<number>
Fetch the number of members in this chat.
send(text: string, options?: Without$1<SendMessageParams, 'text'>): Promise<Message>;| Parameter | Type |
|---|---|
| text | string |
| options? | Without$1<SendMessageParams, 'text'> |
Returns Promise<Message>
Send a text message to this chat.
sendChatAction(action: SendChatActionParams['action'], options?: Without$1<SendChatActionParams, 'action'>): Promise<boolean>;| Parameter | Type |
|---|---|
| action | SendChatActionParams['action'] |
| options? | Without$1<SendChatActionParams, 'action'> |
Returns Promise<boolean>
Tell the user that something is happening on the bot's side (e.g. "typing").
sendDocument(document: SendDocumentParams['document'], options?: Without$1<SendDocumentParams, 'document'>): Promise<Message>;| Parameter | Type |
|---|---|
| document | SendDocumentParams['document'] |
| options? | Without$1<SendDocumentParams, 'document'> |
Returns Promise<Message>
Send a document/file to this chat.
sendPhoto(photo: SendPhotoParams['photo'], options?: Without$1<SendPhotoParams, 'photo'>): Promise<Message>;| Parameter | Type |
|---|---|
| photo | SendPhotoParams['photo'] |
| options? | Without$1<SendPhotoParams, 'photo'> |
Returns Promise<Message>
Send a photo to this chat.
unbanMember(userId: number, onlyIfBanned?: boolean): Promise<boolean>;| Parameter | Type |
|---|---|
| userId | number |
| onlyIfBanned? | boolean |
Returns Promise<boolean>
Unban a previously banned user.