botbuilder-community-dotnet icon indicating copy to clipboard operation
botbuilder-community-dotnet copied to clipboard

Attachments are coming as null - Twitter Adapter

Open dileepkantapop opened this issue 3 years ago • 1 comments

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?

dileepkantapop avatar Dec 06 '21 12:12 dileepkantapop

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" } } } }

muratkakun avatar Jul 01 '22 09:07 muratkakun