Skip to content

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

Class: ChatMember

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

This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

  • ChatMemberOwner
  • ChatMemberAdministrator
  • ChatMemberMember
  • ChatMemberRestricted
  • ChatMemberLeft
  • ChatMemberBanned

Constructors

Constructor

new ChatMember(payload): ChatMember

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

Parameters

ParameterType
payloadRecord<string, any> & TelegramChatMemberOwner | Record<string, any> & TelegramChatMemberAdministrator | Record<string, any> & TelegramChatMemberMember | Record<string, any> & TelegramChatMemberRestricted | Record<string, any> & TelegramChatMemberLeft | Record<string, any> & TelegramChatMemberBanned

Returns

ChatMember

Properties

PropertyTypeDefined in
payloadRecord<string, any> & TelegramChatMemberOwner | Record<string, any> & TelegramChatMemberAdministrator | Record<string, any> & TelegramChatMemberMember | Record<string, any> & TelegramChatMemberRestricted | Record<string, any> & TelegramChatMemberLeft | Record<string, any> & TelegramChatMemberBannedcontexts/index.d.ts:3793

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

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

MDN

Returns

string


customTitle

Get Signature

get customTitle(): string

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

Owner and administrators only. Custom title for this user

Returns

string


status

Get Signature

get status(): "creator" | "administrator" | "member" | "restricted" | "left" | "kicked"

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

The member's status in the chat

Returns

"creator" | "administrator" | "member" | "restricted" | "left" | "kicked"


tag

Get Signature

get tag(): string

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

Tag of the member; for members and restricted members

Returns

string


untilDate

Get Signature

get untilDate(): number

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

Restricted and kicked only. Date when restrictions will be lifted for this user; unix time

Returns

number


user

Get Signature

get user(): User

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

Information about the user

Returns

User

Methods

canAddWebPagePreviews()

canAddWebPagePreviews(): boolean

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

Restricted only true, if the user is allowed to add web page previews to their messages

Returns

boolean


canBeEdited()

canBeEdited(): boolean

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

Administrators only. true, if the bot is allowed to edit administrator privileges of that user

Returns

boolean


canChangeInfo()

canChangeInfo(): boolean

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

Administrators and restricted only. true, if the user is allowed to change the chat title, photo and other settings

Returns

boolean


canDeleteMessages()

canDeleteMessages(): boolean

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

Administrators only. true, if the administrator can delete messages of other users

Returns

boolean


canDeleteStories()

canDeleteStories(): any

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

true, if the administrator can delete stories posted by other users; channels only

Returns

any


canEditMessages()

canEditMessages(): boolean

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

Administrators only. true, if the administrator can edit messages of other users and can pin messages; channels only

Returns

boolean


canEditStories()

canEditStories(): any

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

true, if the administrator can edit stories posted by other users; channels only

Returns

any


canEditTag()

canEditTag(): boolean

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

true, if the user is allowed to edit their own tag; for restricted members

Returns

boolean


canInviteUsers()

canInviteUsers(): boolean

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

Administrators and restricted only. true, if the user is allowed to invite new users to the chat

Returns

boolean


canManageChat()

canManageChat(): boolean

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

Administrators only. true, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

Returns

boolean


canManageDirectMessages()

canManageDirectMessages(): boolean

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

true, if the administrator can manage direct messages of the channel and decline suggested posts; channels only

Returns

boolean


canManageTags()

canManageTags(): boolean

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

true, if the administrator can edit the tags of regular members; for groups and supergroups only

Returns

boolean


canManageTopics()

canManageTopics(): boolean

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

true, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

Returns

boolean


canManageVideoChats()

canManageVideoChats(): boolean

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

Administrators only. true, if the administrator can manage video chats

Returns

boolean


canPinMessages()

canPinMessages(): boolean

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

Administrators and restricted only. true, if the user is allowed to pin messages; groups and supergroups only

Returns

boolean


canPostMessages()

canPostMessages(): boolean

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

Administrators only. true, if the administrator can post in the channel; channels only

Returns

boolean


canPostStories()

canPostStories(): any

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

true, if the administrator can post stories in the channel; channels only

Returns

any


canPromoteMembers()

canPromoteMembers(): boolean

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

Administrators only. true, if the administrator can add new administrators with a subset o their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)

Returns

boolean


canRestrictMembers()

canRestrictMembers(): boolean

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

Administrators only. true, if the administrator can restrict, ban or unban chat members

Returns

boolean


canSendAudios()

canSendAudios(): boolean

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

true, if the user is allowed to send audios

Returns

boolean


canSendDocuments()

canSendDocuments(): boolean

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

true, if the user is allowed to send documents

Returns

boolean


canSendMessages()

canSendMessages(): boolean

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

Restricted only. true, if the user is allowed to send text messages, contacts, locations and venues

Returns

boolean


canSendOtherMessages()

canSendOtherMessages(): boolean

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

Restricted only. true, if the user is allowed to send animations, games, stickers and use inline bots

Returns

boolean


canSendPhotos()

canSendPhotos(): boolean

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

true, if the user is allowed to send photos

Returns

boolean


canSendPolls()

canSendPolls(): boolean

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

Restricted only. true, if the user is allowed to send polls

Returns

boolean


canSendVideoNotes()

canSendVideoNotes(): boolean

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

true, if the user is allowed to send video notes

Returns

boolean


canSendVideos()

canSendVideos(): boolean

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

true, if the user is allowed to send videos

Returns

boolean


canSendVoiceNotes()

canSendVoiceNotes(): boolean

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

true, if the user is allowed to send voice notes

Returns

boolean


isAnonymous()

isAnonymous(): boolean

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

Owner and administrators only. true, if the user's presence in the chat is hidden

Returns

boolean


isMember()

isMember(): boolean

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

Restricted only. true, if the user is a member of the chat at the moment of the request

Returns

boolean