Chat
A text-based means of communication with an Application.
Extends
EventEmitter
<{close
: [];error
: [Error
];gluedText
: [string
];text
: [string
]; }>
Extended by
Constructors
new Chat()
new Chat(
account
,conversation
?):Chat
Create a Chat instance to use with an application.
Parameters
account
Dasha account to use. Must be the same as the application's account.
conversation?
Returns
Overrides
EventEmitter<{ error: [error: errors.Error]; text: [text: string]; close: []; gluedText: [text: string]; }>.constructor
Properties
account
protected
account:Account
Dasha account to use. Must be the same as the application's account.
Methods
close()
close():
Promise
<void
>
Close the chat, notifying the application.
Returns
Promise
<void
>
sendText()
sendText(
text
):Promise
<void
>
Send some text to the application.
Parameters
text
string
Returns
Promise
<void
>
sendTextAndReceiveResponse()
sendTextAndReceiveResponse(
text
):Promise
<string
>
Send some text and wait for response
Parameters
text
string
Returns
Promise
<string
>