@butlerbot/sdk 0.0.6-alpha.4 → 0.0.6-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -144,8 +144,11 @@ class Conversation {
|
|
|
144
144
|
/** Sends a message into the conversation */
|
|
145
145
|
send(message, cb, options) {
|
|
146
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
const
|
|
148
|
-
)
|
|
147
|
+
const payload = Object.assign(Object.assign({ message }, this.options), options // overwrite convos for this call
|
|
148
|
+
);
|
|
149
|
+
if (this.convoId)
|
|
150
|
+
payload.chatId = this.convoId;
|
|
151
|
+
const url = this.formatURL(this.endpoints.conversation, payload);
|
|
149
152
|
const sse = new eventsource_1.EventSource(url);
|
|
150
153
|
sse.addEventListener("message", (event) => {
|
|
151
154
|
const data = JSON.parse(event.data);
|