Bot Framework是否有任何管理API

时间:2017-11-08 15:22:12

标签: botframework

我希望使用Microsoft Bot Framework在我的应用程序中构建一个多Chanel bot服务,我无法找到管理创建bot应用程序,在bot中添加和更新频道的文档。是否可以通过编程方式进行这些活动?

2 个答案:

答案 0 :(得分:2)

不,这是不可能的。目前还没有API。

答案 1 :(得分:0)

我找到了解决方案。有一个API Microsoft Azure管理Bot服务库 安装软件包Microsoft.Azure.Management.BotService-版本0.9.1-preview

    public string RegisterFbChanelTest()
        {
            var credentials = SdkContext.AzureCredentialsFactory.FromFile("azureauth.json");
            var client = new AzureBotServiceClient(credentials){SubscriptionId = "xxxxx"};

            var fbChanel = new FacebookChannel();
            fbChanel.Properties = new FacebookChannelProperties()
            {
                AppId = "xxxxxxxxxxxx",
                AppSecret = "xxxxxxxxxxxxxxxxxxx",
                IsEnabled = true,
                Pages = new List<FacebookPage>()
                {
                    new FacebookPage()
                    {
                        Id ="xxxxxxxxxxxxxxxxxx",
                        AccessToken = "xxxxxxxxxxxxxx"
                    }
                }
            };

            var chanel = new BotChannel(
                name: @"buttlerbot/FacebookChannel",
                type: "Microsoft.BotService/botServices/channels",
                location: "global",
                properties: fbChanel,
 type: "Microsoft.BotService/botServices/channels",

                );

            var chanels = client.Channels.ListByResourceGroup("bots", "xbuttlerbot");

            //  client.Channels.Delete("bots", "xbuttlerbot", "FacebookChannel");
            var result = client.Channels.Create("bots", "xbuttlerbot", Microsoft.Azure.Management.BotService.Models.ChannelName.FacebookChannel,
             chanel
                 );
            return "";
        }

确保检查“ Azure门户中的机器人活动”。

AzurePortalBotActivity