botbuilder-community-dotnet
botbuilder-community-dotnet copied to clipboard
Attachments are coming as null - Twitter Adapter
Hi,
We have a feature in the bot to upload an image as an attachment, working fine with other channels getting it in attachments array in activity. Whereas in Twitter we are getting attachments array as null, But getting an URL like https://t.co/obABWzoizQ for Text field in activity. This URL takes to the Twitter chatting page of the logged-in user.
Need to know how can I access the attached image from the URL or any other way to get it as an attachment?
You need to check twitter payload and map coming request's attachment property to Activitiy's attachment propery,
i checked twitter payload and it is ;
"attachment": { "type": "media", "media": { "id": 1542798170257870800, "id_str": "1542798170257870849", "indices": [ 1, 24 ], "media_url": "https://ton.twitter.com/1.1/ton/data/dm/1542798187550986244/1542798170257870849/BUHFx2cU.png", "media_url_https": "https://ton.twitter.com/1.1/ton/data/dm/1542798187550986244/1542798170257870849/BUHFx2cU.png", "url": "https://t.co/PuLt0zppgV", "display_url": "pic.twitter.com/PuLt0zppgV", "expanded_url": "https://twitter.com/messages/media/1542798187550986244", "type": "photo", "sizes": { "medium": { "w": 600, "h": 413, "resize": "fit" }, "small": { "w": 600, "h": 413, "resize": "fit" }, "large": { "w": 600, "h": 413, "resize": "fit" }, "thumb": { "w": 150, "h": 150, "resize": "crop" } } } }