Skip to content

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

Class: User

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

This object represents a Telegram user or bot.

Constructors

Constructor

new User(payload): User

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

Parameters

ParameterType
payloadTelegramUser

Returns

User

Properties

PropertyTypeDefined in
payloadTelegramUsercontexts/index.d.ts:477

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

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

MDN

Returns

string


addedToAttachmentMenu

Get Signature

get addedToAttachmentMenu(): true

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

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:486

User's or bot's first name

Returns

string


id

Get Signature

get id(): number

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

Unique identifier for this user or bot

Returns

number


languageCode

Get Signature

get languageCode(): string

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

IETF language tag of the user's language

Returns

string


lastName

Get Signature

get lastName(): string

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

User's or bot's last name

Returns

string


username

Get Signature

get username(): string

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

User's or bot's username

Returns

string

Methods

allowsUsersToCreateTopics()

allowsUsersToCreateTopics(): boolean

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

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:523

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:505

true, if the bot can be invited to groups.

Returned only in getMe.

Returns

boolean


canReadAllGroupMessages()

canReadAllGroupMessages(): boolean

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

true, if privacy mode is disabled for the bot.

Returned only in getMe.

Returns

boolean


isBot()

isBot(): boolean

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

true, if this user is a bot

Returns

boolean


isPremium()

isPremium(): true

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

true, if this user is a Telegram Premium user

Returns

true


supportsInlineQueries()

supportsInlineQueries(): boolean

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

true, if the bot supports inline queries.

Returned only in getMe.

Returns

boolean