new Chat()

Extends
Base

Properties

archived  boolean

Indicates if the Chat is archived

id  object

ID that represents the chat

isGroup  boolean

Indicates if the Chat is a Group Chat

isReadOnly  boolean

Indicates if the Chat is readonly

name  string

Title of the chat

timestamp  number

Unix timestamp for when the chat was created

unreadCount  number

Amount of messages unread

Methods

async

archive()

Archives this chat

async

clearMessages() → Promise containing Boolean

Clears all messages from the chat

Returns

Promise containing Boolean 

result

async

delete() → Promise containing Boolean

Deletes the chat

Returns

Promise containing Boolean 

result

async

sendMessage(content, options) → Promise containing Message

Send a message to this chat

Parameters

Name Type Optional Description

content

(string, MessageMedia, or Location)

 

options

object

 

Returns

Promise containing Message 

Message that was just sent

async

unarchive()

un-archives this chat