From f8385a8e37e41ca0b9c9b00e6177d2cce4b1fd53 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Wed, 8 Mar 2023 17:04:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=BB=8D=E7=84=B6=E8=BF=94=E5=9B=9E=E9=A3=8E?= =?UTF-8?q?=E6=8E=A7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/SydneyAIClient.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/utils/SydneyAIClient.js b/utils/SydneyAIClient.js index 57ade8e..2891a2f 100644 --- a/utils/SydneyAIClient.js +++ b/utils/SydneyAIClient.js @@ -449,6 +449,20 @@ export default class SydneyAIClient { reject('Unexpected message author.') return } + if (messages[0].contentOrigin === 'Apology') { + console.log('Apology found') + stopTokenFound = true + clearTimeout(messageTimeout) + clearTimeout(firstTimeout) + this.cleanupWebSocketConnection(ws) + message.adaptiveCards[0].body[0].text = replySoFar + message.text = replySoFar + resolve({ + message, + conversationExpiryTime: event?.item?.conversationExpiryTime + }) + return + } if (event.item?.result?.error) { if (this.debug) { console.debug(event.item.result.value, event.item.result.message)