Skip to content

Commit

Permalink
Logging, await adding participant to convo
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhand committed May 24, 2024
1 parent 88e65fa commit 4163c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export const redirectConversationMessageToExternalChat = async (
const { attributes } = await client.conversations.v1.conversations(ConversationSid).fetch();
console.log('conversationAttributes', attributes);

const conversationAttributes = JSON.parse(attributes);
const { participantSid } = JSON.parse(attributes);

// Redirect bot, system or third participant, but not self
if (conversationAttributes.participantSid !== ParticipantSid) {
if (participantSid && participantSid !== ParticipantSid) {
const response = await sendExternalMessage(recipientId, Body);
return { status: 'sent', response };
}
Expand Down
4 changes: 4 additions & 0 deletions functions/webhooks/FlexChannelUpdate.protected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export const handler = async (
event: Body,
callback: ServerlessCallback,
) => {
console.log('=== FlexChannelUpdate.protected ===');
Object.entries(event).forEach(([key, value]) => {
console.log(`${key}: ${value}`);
});
const response = responseWithCors();
const resolve = bindResolve(callback)(response);

Expand Down

0 comments on commit 4163c37

Please sign in to comment.