@enegelai/bot-widget 1.7.2 → 1.7.3
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.
- package/dist/enegelaibot.umd.js +3 -3
- package/dist/index.es.js +7 -6
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1009,13 +1009,14 @@ class W extends Ke {
|
|
|
1009
1009
|
this.streamingResponseBuffer = null, this.streamingResponseTagStartPos = 0, this.streamingResponseCurrentTag = null;
|
|
1010
1010
|
}
|
|
1011
1011
|
processStreamingResponseTagImg() {
|
|
1012
|
-
if (!
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
this.streamingResponseBuffer.indexOf(")") !== -1 && (j.info(`IMG TAG END: ${this.streamingResponseBuffer}`), this.isValidImageLink(this.streamingResponseBuffer) && (this.replyMessage = this.updateMessage(this.replyMessage, this.streamingResponseBuffer)), this.streamingResponseBuffer = null, this.streamingResponseCurrentTag = null);
|
|
1012
|
+
if (!this.streamingResponseBuffer || !this.replyMessage)
|
|
1013
|
+
return;
|
|
1014
|
+
if (this.streamingResponseBuffer.indexOf("![") === -1) {
|
|
1015
|
+
j.info(`NOT IMG TAG: ${this.streamingResponseBuffer}`), this.replyMessage = this.updateMessage(this.replyMessage, this.streamingResponseBuffer), this.streamingResponseBuffer = null, this.streamingResponseCurrentTag = null;
|
|
1016
|
+
return;
|
|
1018
1017
|
}
|
|
1018
|
+
const e = this.streamingResponseBuffer.lastIndexOf("]"), c = this.streamingResponseBuffer.lastIndexOf(")");
|
|
1019
|
+
e === -1 || c === -1 || e > c || (j.info(`IMG TAG END: ${this.streamingResponseBuffer}`), this.isValidImageLink(this.streamingResponseBuffer) && (this.replyMessage = this.updateMessage(this.replyMessage, this.streamingResponseBuffer)), this.streamingResponseBuffer = null, this.streamingResponseCurrentTag = null);
|
|
1019
1020
|
}
|
|
1020
1021
|
isValidImageLink(e = "") {
|
|
1021
1022
|
return !(e.indexOf("example.com") !== -1 || e.indexOf("imgur.com") !== -1 || e.indexOf("attachment:") !== -1);
|