Skip to content

export Class

ClientUser ​

extends ​

User

Constructor ​

ts
 new ClientUser( client, packet )
ParameterTypeDescription
clientClient
packetUserPacket

Properties ​

adminsitrator_rights : Object ​

default: ...

readonly client : Client ​

description? : string ​

id : number ​

is_bot? : boolean ​

language_code? : string ​

default: {}

message_thread_id? : number ​

name? : string ​

short_description? : string ​

Methods ​

asyncboosts( chat_id ) ​

ParameterTypeDescription
chat_idnumber

Returns: Promise<boolean | ChatBoost[]>

createCallbackCollector( options ) ​

ParameterTypeDescription
options?CallbackCollectorOptionsThe options for the collector.

Creates a callback query collector to the current chat.

Returns: CallbackCollector

createMessageCollector( options ) ​

ParameterTypeDescription
options?MessageCollectorOptionsThe options for the collector.

Creates a message collector to the current chat.

Returns: MessageCollector

asyncget( ) ​

Returns: Promise<ClientUser>

asyncgetBusinessConnection( business_connection_id ) ​

ParameterTypeDescription
business_connection_idstring

Returns: Promise<BusinessConnectionPacket>

asyncgetChatMenuButton( chat_id, force ) ​

ParameterTypeDescription
chat_id?number
force?boolean

Returns: Promise<ChatMenuButton>

asyncgetProfilePhotos( offset, limit ) ​

ParameterTypeDescription
offset?number
limit?number

Returns: Promise<UserProfilePhotos>

asyncsend( method, packet, form ) ​

ParameterTypeDescription
methodMessagePayloadMethodThe method of the message.
packetMessagePayloadThe packet of what the message will contain.
form?FormDataBuilderThe form data for uploading media, see also File .

Sends a message to the current channel.

Returns: Promise<false | Message>

asyncsendInvoice( id ) ​

ParameterTypeDescription
idstringThe id of the invoice.

Sends the stored invoice with the id to the current chat.

Returns: Promise<null | Message>

asyncsendText( text ) ​

ParameterTypeDescription
textstringThe text content of the message.

Sends a text message to the current chat.

Returns: Promise<false | Message>

asyncsetDefaultAdministratorRights( rights, for_channels ) ​

ParameterTypeDescription
rightsChatAdministratorRights
for_channels?boolean

Returns: Promise<boolean>

asyncsetDescription( description, language_code ) ​

ParameterTypeDescription
descriptionstring
language_code?string

Returns: Promise<boolean>

asyncsetMenuButton( menu_button, chat_id ) ​

ParameterTypeDescription
menu_button?string | MenuButtonBuilder
chat_id?number

Returns: Promise<boolean>

asyncsetName( name, language_code ) ​

ParameterTypeDescription
namestring
language_code?string

Returns: Promise<boolean>

asyncsetShortDescription( short_description, language_code ) ​

ParameterTypeDescription
short_descriptionstring
language_code?string

Returns: Promise<boolean>

A modern, powerful library for building your Telegram bots, with seamless support for both JavaScript and Typescript.