TgKit library and website are still in early development!

Chat Class

extends Base

Represents a chat

Properties

client Client

See the code

firstName string

First name of the other party in a private chat

See the code

id number

Unique identifier for this chat

See the code

isForum boolean

*true*, if the supergroup chat is a forum (has topics enabled)

See the code

lastName string

Last name of the other party in a private chat

See the code

title string

Title, for supergroups, channels and group chats

See the code

type ChatType

Type of chat

See the code

username string

Username, for private chats, supergroups and channels if available

See the code

Methods

approveJoinRequest(userId: number): Promise

See the code

banMember(userId: number, options: ChatMemberBanOptions): Promise

See the code

banSenderChat(senderChatId: number): Promise

See the code

closeForumTopic(forumTopicId: number): Promise

See the code

closeGeneralForumTopic(): Promise

See the code

createForumTopic(name: string, options: ForumTopicCreateOptions): Promise

See the code

declineJoinRequest(userId: number): Promise

See the code

deleteForumTopic(forumTopicId: number): Promise

See the code

deleteMyCommands(options: Omit): Promise

See the code

deletePhoto(): Promise

See the code

deleteStickerSet(): Promise

See the code

editForumTopic(forumTopicId: number, options: ForumTopicEditOptions): Promise

See the code

editGeneralForumTopic(options: GeneralForumTopicEditOptions): Promise

See the code

getAdministrators(): Promise

See the code

getMember(userId: number): Promise

See the code

getMemberCount(): Promise

See the code

getMenuButton(): Promise

See the code

getMyCommands(options: Omit): Promise

See the code

hideGeneralForumTopic(): Promise

See the code

leave(): Promise

See the code

pinMessage(messageId: number, options: ChatMessagePinOptions): Promise

See the code

promoteMember(userId: number, options: ChatMemberPromoteOptions): Promise

See the code

reopenForumTopic(forumTopicId: number): Promise

See the code

reopenGeneralForumTopic(): Promise

See the code

restrictMember(userId: number, permissions: ChatPermissions, options: ChatMemberRestrictOptions): Promise

See the code

sendAnimation(animation: string, options: AnimationMessageSendOptions): Promise

See the code

sendAudio(audio: string, options: AudioMessageSendOptions): Promise

See the code

sendChatAction(action: ChatAction): Promise

See the code

sendContact(contact: ContactOptions, options: ContactMessageSendOptions): Promise

See the code

sendDice(emoji: DiceEmoji, options: DiceMessageSendOptions): Promise

See the code

sendDocument(document: string, options: DocumentMessageSendOptions): Promise

See the code

sendInvoice(options: InvoiceSendOptions): Promise

See the code

sendLocation(latitude: number, longitude: number, options: LocationMessageSendOptions): Promise

See the code

sendMediaGroup(media: undefined, options: MediaGroupMessageSendOptions): Promise

See the code

sendMessage(text: string, options: TextMessageSendOptions): Promise

See the code

sendPhoto(photo: string, options: PhotoMessageSendOptions): Promise

See the code

sendPoll(poll: PollOptions, options: PollMessageSendOptions): Promise

See the code

sendSticker(sticker: string, options: StickerSendOptions): Promise

See the code

sendVenue(venue: VenueOptions, options: VenueMessageSendOptions): Promise

See the code

sendVideo(video: string, options: VideoMessageSendOptions): Promise

See the code

sendVideoNote(videoNote: string, options: AudioMessageSendOptions): Promise

See the code

sendVoice(voice: string, options: AudioMessageSendOptions): Promise

See the code

setAdministratorCustomTitle(userId: number, customTitle: string): Promise

See the code

setDescription(description: string): Promise

See the code

setMenuButton(menuButton: MenuButton): Promise

See the code

setMyCommands(commands: undefined, options: Omit): Promise

See the code

setPermissions(permissions: ChatPermissions): Promise

See the code

setPhoto(photo: string): Promise

See the code

setStickerSet(stickerSetName: string): Promise

See the code

setTitle(title: string): Promise

See the code

unbanMember(userId: number, options: ChatMemberUnbanOptions): Promise

See the code

unbanSenderChat(senderChatId: number): Promise

See the code

unhideGeneralForumTopic(): Promise

See the code

unpinAllForumTopicMessages(forumTopicId: number): Promise

See the code

unpinAllMessages(): Promise

See the code

unpinMessage(messageId: number): Promise

See the code