Forum Discussion
Send attachment from teams personal chat to teams group channel using bot framework
My requirement is for sending attachments (images/ screenshots/smiley) from team's channel to the personal chat and vice versa . (not directly attaching a png/jpeg file. Need to send the same attachment from the sender to the recipient )
The example shared works fine while sending message but note for attachments (images/screenhots/smiley) But while adding the attachment from user activity to teams channel activity it is throwing exception as 'Bad Request'
I want to send the screenshot from personal chat to teams channel and vice versa
var message = Activity.CreateMessageActivity();
message.From = new ChannelAccount { Id = recipient.Bot.Id };
message.Conversation = new ConversationAccount { Id = conversationId };
message.Text = "Hello from the bot in the Teams channel!";
message.Attachments = messageActivity.Attachments; ('messageActivity' will be the sender and 'message' should be the activity send to the recepient with the attachment send from sender )
'messageActivity' will be the sender and 'message' should be the activity send to the recipient with the attachment send from sender.
Sayali-MSFT , is there any alternative to send images as attachments from personal chat to teams channel and vice versa.
- LimnaAdminSep 28, 2023Copper Contributor
@Sayali-MSFT , is there any update on this query
- Sayali-MSFTSep 28, 2023
Microsoft
Could you please look into this sample-https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-add-media-attachments?view=azure-bot-service-4.0&tabs=csharp- LimnaAdminSep 29, 2023Copper Contributor
This document doesn't contain any sample by passing the same attachment from the teams sender to the recipient.
In all these samples, they are directly attaching the image address or providing the image path in the system itself. That is working scenario which we have already tested.
This is not the user case scenario that we needed we want to send the message activity which contains the attachment from the sender to the recipient.