wingbot 3.76.4-alpha.14 → 3.76.4-alpha.15
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/package.json
CHANGED
|
@@ -16,13 +16,19 @@ function extractText (payload) {
|
|
|
16
16
|
return payload.message.text;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
// button message
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
// button message — the orchestrator normalizes a singular `attachment` into
|
|
20
|
+
// a plural `attachments` array before persisting, so accept both shapes;
|
|
21
|
+
// otherwise template messages (e.g. button templates) logged via the
|
|
22
|
+
// orchestrator drop out of the transcript entirely.
|
|
23
|
+
const attachment = payload.message
|
|
24
|
+
&& (payload.message.attachment
|
|
25
|
+
|| (Array.isArray(payload.message.attachments) && payload.message.attachments[0]));
|
|
26
|
+
if (attachment
|
|
27
|
+
&& attachment.type === 'template'
|
|
28
|
+
&& attachment.payload
|
|
29
|
+
&& attachment.payload.text) {
|
|
30
|
+
|
|
31
|
+
return attachment.payload.text;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
if (!payload.postback) {
|