Skip to content

Commit

Permalink
print out debug message for Direct message flow
Browse files Browse the repository at this point in the history
  • Loading branch information
JackuB committed Jan 21, 2024
1 parent dd0942f commit e034be2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,16 @@ app.view('mermaid-modal-submitted', async ({ ack, body, logger, client }) => {

// Check for direct message
if (origin.channel.startsWith('D')) {
logger.info('Direct message detected');
try {
const userChannel = await client.conversations.open({
users: origin.user_id,
});
channelToUpload = userChannel.channel?.id
? userChannel.channel.id
: channelToUpload;
logger.info('User channel', userChannel);
logger.info('Channel selected', channelToUpload);
} catch (error) {
logger.error('Failed to open an user channel, but continuing', error);
}
Expand Down

0 comments on commit e034be2

Please sign in to comment.