diff --git a/functions/channelCapture/chatbotCallback.protected.ts b/functions/channelCapture/chatbotCallback.protected.ts index 154b4199..58fd0d19 100644 --- a/functions/channelCapture/chatbotCallback.protected.ts +++ b/functions/channelCapture/chatbotCallback.protected.ts @@ -112,10 +112,10 @@ export const handler = async ( return; } - console.log('conversation / channel attributes:', attributesJson); - const channelAttributes = JSON.parse(attributesJson || '{}'); + console.log('conversation / channel attributes:', channelAttributes); + // Send message to bot only if it's from child const eventTypeCheck = EventType === 'onMessageSent' || EventType === 'onMessageAdded'; const userIdentityCheck = @@ -132,9 +132,9 @@ export const handler = async ( console.log('capturedChannelAttributes is here', capturedChannelAttributes); const lexResult = await lexClient.postText(context, { - botName: capturedChannelAttributes?.botName, - botAlias: capturedChannelAttributes?.botAlias, - userId: capturedChannelAttributes?.userId, + botName: capturedChannelAttributes.botName, + botAlias: capturedChannelAttributes.botAlias, + userId: capturedChannelAttributes.userId, inputText: Body, });