You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm trying to send a message from the Bot to the User. Have followed the guidelines as layed out here: https://docs.botframework.com/en-us/csharp/builder/sdkreference/routing.html specifically, the Create 1:1 Conversations section. The sample code does work, however, it only works when I substitute the original conversationId received from the emulator for the conversationId created by CreateDirectConversationAsync. So it seems CreateDirectConversationAsync is not generating a useful conversationId?
Here is my code:
//hardcoded values retrieved from the emulator - inspecting an incoming message.
var botAccount = new ChannelAccount("56800324", "Bot1");
var userAccount = new ChannelAccount(name: "User1", id: "2c1c7fa3");
var connector = new ConnectorClient(new Uri("http://localhost:9000/"));
//var conversationId = await connector.Conversations.CreateDirectConversationAsync(botAccount, userAccount);
IMessageActivity message = Activity.CreateMessageActivity();
message.From = botAccount;
message.Recipient = userAccount;
//this is the orignal conversationId as the emulator sent.
//Using it works - the message is received in the emulator.
//Using conversationId.Id does not work - No message is received in the emulator
var hardcodedId = "8a684db8";
message.Conversation = new ConversationAccount(id: hardcodedId, name: "Conv1", isGroup: false);
message.Text = "Hi there";
await connector.Conversations.SendToConversationAsync((Activity)message);
Any feedback would be much appreciated. I have seen similar issues here: #698 but that sample code suggestion also does not work.
The text was updated successfully, but these errors were encountered:
The code snippet below produces the following results in emulator and the CreateDirectConversation(...) works. Make sure to look for the direct conversation showing up as Bot1-User1 from conversation names drop down in emulator.
Hi there.
So I'm trying to send a message from the Bot to the User. Have followed the guidelines as layed out here: https://docs.botframework.com/en-us/csharp/builder/sdkreference/routing.html specifically, the Create 1:1 Conversations section. The sample code does work, however, it only works when I substitute the original conversationId received from the emulator for the conversationId created by CreateDirectConversationAsync. So it seems CreateDirectConversationAsync is not generating a useful conversationId?
Here is my code:
Any feedback would be much appreciated. I have seen similar issues here: #698 but that sample code suggestion also does not work.
The text was updated successfully, but these errors were encountered: