Send 500 error message to Microsoft BotConnectorBot

I am working with Bot Connector to reply to a message. I use the incomingMessage.CreateReplyMessage () method, but it worked with the new ConnectorClient () connector and 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("今あなたの家の前にいるの"); } 
+5
source share
3 answers

I had the same problem, but fooobar.com/questions/1249235 / ... helped me solve it.

 using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message)) { var client = scope.Resolve<IConnectorClient>(); client.Messages.SendMessage(message); } 
+2
source

There was the same problem, and in my case it was because I used the Bot Framework emulator to call my bot logic (Post method). The only way I got a direct connection through ConnectorClient is to do a real end-to-end test through a configured channel (for example, Skype).

+1
source

Try the following:

 var connector = new ConnectorClient(new Uri("http://localhost:9000"), new ConnectorClientCredentials()); connector.Messages.SendMessage(message.CreateReplyMessage("Simple Text")); 
0
source

All Articles