GramIO API Reference / @gramio/contexts/dist / User
Class: User
Defined in: contexts/index.d.ts:484
This object represents a Telegram user or bot.
Constructors
Constructor
new User(
payload):User
Defined in: contexts/index.d.ts:486
Parameters
| Parameter | Type |
|---|---|
payload | TelegramUser |
Returns
User
Properties
| Property | Type | Defined in |
|---|---|---|
payload | TelegramUser | contexts/index.d.ts:485 |
Accessors
[toStringTag]
Get Signature
get [toStringTag]():
string
Defined in: contexts/index.d.ts:488
Returns
string
addedToAttachmentMenu
Get Signature
get addedToAttachmentMenu():
true
Defined in: contexts/index.d.ts:507
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:494
User's or bot's first name
Returns
string
id
Get Signature
get id():
number
Defined in: contexts/index.d.ts:490
Unique identifier for this user or bot
Returns
number
languageCode
Get Signature
get languageCode():
string
Defined in: contexts/index.d.ts:503
IETF language tag of the user's language
Returns
string
lastName
Get Signature
get lastName():
string
Defined in: contexts/index.d.ts:496
User's or bot's last name
Returns
string
username
Get Signature
get username():
string
Defined in: contexts/index.d.ts:498
User's or bot's username
Returns
string
Methods
allowsUsersToCreateTopics()
allowsUsersToCreateTopics():
boolean
Defined in: contexts/index.d.ts:537
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:531
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:513
true, if the bot can be invited to groups.
Returned only in getMe.
Returns
boolean
canManageBots()
canManageBots():
boolean
Defined in: contexts/index.d.ts:543
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:519
true, if privacy mode is disabled for the bot.
Returned only in getMe.
Returns
boolean
isBot()
isBot():
boolean
Defined in: contexts/index.d.ts:492
true, if this user is a bot
Returns
boolean
isPremium()
isPremium():
true
Defined in: contexts/index.d.ts:505
true, if this user is a Telegram Premium user
Returns
true
supportsInlineQueries()
supportsInlineQueries():
boolean
Defined in: contexts/index.d.ts:525
true, if the bot supports inline queries.
Returned only in getMe.
Returns
boolean