Chat

chat.Chat

A text-based means of communication with an Application.

Hierarchy

  • EventEmitter<{ close: [] ; error: [error: Error] ; text: [text: string] }>

    Chat

Constructors

constructor

+ new Chat(account: Account, conversation?: Conversation<Record<string, unknown>, Record<string, unknown>>): Chat

Create a Chat instance to use with an application.

Parameters:

NameTypeDescription
accountAccountDasha account to use. Must be the same as the application's account.
conversation?Conversation<Record<string, unknown>, Record<string, unknown>>-

Returns: Chat

Overrides: EventEmitter<{ error: [error: errors.Error]; text: [text: string]; close: []; }>.constructor

Properties

account

Protected account: Account

Methods

close

close(): Promise<void>

Close the chat, notifying the application.

Returns: Promise<void>


sendText

sendText(text: string): Promise<void>

Send some text to the application.

Parameters:

NameType
textstring

Returns: Promise<void>

Found a mistake? Email us, and we'll send you a free t-shirt!

Enroll in beta

Request invite to our private Beta program for developers to join the waitlist. No spam, we promise.