Skip to content

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

Class: Chat ​

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

This object represents a chat.

Documentation

Constructors ​

Constructor ​

new Chat(payload): Chat

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

Parameters ​

ParameterType
payloadTelegramChat

Returns ​

Chat

Properties ​

PropertyTypeDefined in
payloadTelegramChatcontexts/index.d.ts:939

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string


firstName ​

Get Signature ​

get firstName(): string

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

Optional. First name of the other party in a private chat

Returns ​

string


id ​

Get Signature ​

get id(): number

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

Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

Returns ​

number


isDirectMessages ​

Get Signature ​

get isDirectMessages(): true

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

Optional. True, if the chat is the direct messages chat of a channel

Returns ​

true


isForum ​

Get Signature ​

get isForum(): true

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

Optional. True, if the supergroup chat is a forum (has topics enabled)

Returns ​

true


lastName ​

Get Signature ​

get lastName(): string

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

Optional. Last name of the other party in a private chat

Returns ​

string


title ​

Get Signature ​

get title(): string

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

Optional. Title, for supergroups, channels and group chats

Returns ​

string


type ​

Get Signature ​

get type(): TelegramChatType

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

Type of the chat, can be either “private”, “group”, “supergroup” or “channel”

Returns ​

TelegramChatType


username ​

Get Signature ​

get username(): string

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

Optional. Username, for private chats, supergroups and channels if available

Returns ​

string