I'm working with Bot Connector to reply message. I using incomingMessage.CreateReplyMessage() it worked, but i new ConnectorClient() to reply then 500 Internal Server Error. Non-bots can't talk to non-bots
public async Task<Message> Post([FromBody]Message incomingMessage)
{
var connector = new ConnectorClient();
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("ねぇ"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("お返事ちょうだい?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("なんでお返事くれないの?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("どうして?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("私のこと捨てるの?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("ねぇ"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("なんで?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("嘘つき"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("なんでこんなひどいことするの?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("なんで?"));
connector.Messages.SendMessage(incomingMessage.CreateReplyMessage("なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?なんで?"));
return incomingMessage.CreateReplyMessage("今あなたの家の前にいるの");
}
I had a same problem, but https://stackoverflow.com/a/37334528/5951301 helped me to solve it:
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
{
var client = scope.Resolve<IConnectorClient>();
client.Messages.SendMessage(message);
}
Had the same problem, and in my case it was because I was using the Bot Framework Emulator to invoke my bot logic (the Post method). The only way I got the direct connection via ConnectorClient working was to do a real end-to-end test via a configured channel (like Skype).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With