本文介绍了为Botframework Bot配置自定义端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用C#创建一个机器人.如何设置端点的路径.
I want to create a bot in C#. How can I set the path for the endpoint.
我试图做
httpConfiguration.MapBotFramework(botConfig =>
{
botConfig.UsePaths(paths => {
paths.BasePath = "/bot";
paths.MessagesPath = "/john";
});
});
但是当访问http://localhost:7990/bot/john
时,我确实得到了404.
But when accessing http://localhost:7990/bot/john
I do get a 404.
推荐答案
实际上,对我有用的代码如下:
Actually the code that worked for me is like below:
httpConfiguration.MapBotFramework(botConfig =>
{
botConfig.BotFrameworkOptions.Paths = new BotFrameworkPaths()
{
BasePath = "/bot",
MessagesPath = "/john"
};
});
这篇关于为Botframework Bot配置自定义端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!