Skip to content

GramIO API Reference / @gramio/contexts/dist / User

Class: User ​

Defined in: contexts/index.d.ts:591

This object represents a Telegram user or bot.

Constructors ​

Constructor ​

new User(payload): User

Defined in: contexts/index.d.ts:593

Parameters ​

ParameterType
payloadTelegramUser

Returns ​

User

Properties ​

PropertyTypeDefined in
payloadTelegramUsercontexts/index.d.ts:592

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

Defined in: contexts/index.d.ts:595

MDN

Returns ​

string


addedToAttachmentMenu ​

Get Signature ​

get addedToAttachmentMenu(): true

Defined in: contexts/index.d.ts:614

true, if this user added the bot to the attachment menu

Returns ​

true


firstName ​

Get Signature ​

get firstName(): string

Defined in: contexts/index.d.ts:601

User's or bot's first name

Returns ​

string


id ​

Get Signature ​

get id(): number

Defined in: contexts/index.d.ts:597

Unique identifier for this user or bot

Returns ​

number


languageCode ​

Get Signature ​

get languageCode(): string

Defined in: contexts/index.d.ts:610

IETF language tag of the user's language

Returns ​

string


lastName ​

Get Signature ​

get lastName(): string

Defined in: contexts/index.d.ts:603

User's or bot's last name

Returns ​

string


username ​

Get Signature ​

get username(): string

Defined in: contexts/index.d.ts:605

User's or bot's username

Returns ​

string

Methods ​

allowsUsersToCreateTopics() ​

allowsUsersToCreateTopics(): boolean

Defined in: contexts/index.d.ts:650

true, if the bot allows users to create and delete topics in private chats.

Returned only in getMe.

Returns ​

boolean


canConnectToBusiness() ​

canConnectToBusiness(): boolean

Defined in: contexts/index.d.ts:644

true, if the bot can be connected to a Telegram Business account to receive its messages.

Returned only in getMe.

Returns ​

boolean


canJoinGroups() ​

canJoinGroups(): boolean

Defined in: contexts/index.d.ts:620

true, if the bot can be invited to groups.

Returned only in getMe.

Returns ​

boolean


canManageBots() ​

canManageBots(): boolean

Defined in: contexts/index.d.ts:656

true, if other bots can be created to be controlled by the bot.

Returned only in getMe.

Returns ​

boolean


canReadAllGroupMessages() ​

canReadAllGroupMessages(): boolean

Defined in: contexts/index.d.ts:626

true, if privacy mode is disabled for the bot.

Returned only in getMe.

Returns ​

boolean


isBot() ​

isBot(): boolean

Defined in: contexts/index.d.ts:599

true, if this user is a bot

Returns ​

boolean


isPremium() ​

isPremium(): true

Defined in: contexts/index.d.ts:612

true, if this user is a Telegram Premium user

Returns ​

true


supportsGuestQueries() ​

supportsGuestQueries(): boolean

Defined in: contexts/index.d.ts:632

true, if the bot supports guest queries from chats it is not a member of.

Returned only in getMe.

Returns ​

boolean


supportsInlineQueries() ​

supportsInlineQueries(): boolean

Defined in: contexts/index.d.ts:638

true, if the bot supports inline queries.

Returned only in getMe.

Returns ​

boolean


supportsJoinRequestQueries() ​

supportsJoinRequestQueries(): boolean

Defined in: contexts/index.d.ts:662

true, if the bot supports join request queries and can be assigned to process them.

Returned only in getMe.

Returns ​

boolean