1

My Bot works as an Intermediate channel between users -skype users-, In other words, one of its work to catch a message from one user and forward this message to another one,

Currently, I can get the text and photo message and forward it without any problems, using the below code.

      IMessageActivity message = Activity.CreateMessageActivity();
                   message.Text = msg.text ?? msg.botTalk;
                if (msg.contentType != null && msg.contentUrl != null )
                {
                    message.Attachments.Add(new Attachment
                    {
                        ContentType = "image",
                       ContentUrl = "data:image/jpg;base64," +msg.base64incode,
                    });
                }

                await connector.Conversations.SendToConversationAsync((Activity)message);

The above code works perfectly for (text and image messages); I download images using Httpclient then convert it to base64; the original link for skype some think like this

https://smba.trafficmanager.net/apis/v3/attachments/0-weu-d6-a8a59a9361b6074775a1994bf74e5762/views/original

So is there any way to forward a message without download it and then send especially when sending messages that are not images

AAHN
  • 381
  • 1
  • 4
  • 18
Ayham
  • 11
  • 2
  • Have you tried just setting the ContentUrl of the outgoing message to the contentUrl of the incoming message? – Eric Dahlvang May 08 '18 at 02:00
  • @EricDahlvang yes but it's not work – Ayham May 09 '18 at 17:13
  • I don't think there is a way to do this, since that would be a security issue (allowing one skype client to access an attachment path to another skype client's file). I believe you would need to download the file, and host it... setting the contenturl to the hosted path. https://stackoverflow.com/questions/36492045/how-can-i-attach-file-to-message-with-microsoft-bot-framework – Eric Dahlvang May 31 '18 at 01:09

0 Answers0