parseIncomingMessage (conversation, message) { const msg = {} const attachment = _.get(message, 'attachments[0]') if (attachment) { if (attachment.contentType.startsWith('image')) { msg.attachment = { type: 'picture', content: attachment.contentUrl } } else if (attachment.contentType.startsWith('video')) { msg.attachment = { type: 'video', content: attachment.contentUrl } } else { logger.warning('[Microsoft] No support for files of type: '.concat(attachment.contentType)) logger.info('[Microsoft] Defaulting to text') if (!message.text || message.text.length <= 0) { logger.error('[Microsoft] No text') throw new StopPipeline() } msg.attachment = { type: 'text', content: message.text } } } else { msg.attachment = { type: 'text', content: message.text } } return msg }