我创建了一个机器人应用程序,我已经成功地通过模拟器在本地进行了测试。
在https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html之后,我将机器人应用程序发布到 Azure。(创建为http://mybotappname.azurewebsites.net)
然后,我转到https://dev.botframework.com上的 Microsoft Bot Framework 门户并注册了机器人,并确保将消息传递端点设置为
http s ://mybotappname.azurewebsites.net /api/messages
成功注册后,我更新了 web.config 中的 MicrosoftAppId 和 MicrosoftAppPassword 密钥。
但是,当我尝试“测试与您的机器人的连接”时,我看到的只是一条消息
“未经授权”
我如何调试这是从哪里来的?
我尝试运行 Bot Framework Channel Emulator,将 Bot Url 设置为与我的 Bot 为 Messaging 端点设置的 URL 相同的 URL。这也给了我一条“401 Unauthorized”消息,但我不知道如何/在哪里调试原因。
有没有人经历过这个或知道我可以做些什么来调试?
谢谢
我想绕过像这样定义的表单流中的最后一个确认步骤
new FormBuilder<WizardResult>()
.Confirm("No verification will be shown", state => false)
.Message("Form Test")
.OnCompletion(processOrder)
.Build();
Run Code Online (Sandbox Code Playgroud)
根据这篇文章, 这可以通过处理程序进行确认来完成,但是在我的情况下,仍然需要确认...
我想念什么?
我已经开始将Luis集成到我的BOT中,LUIS查询在浏览器中运行良好,但似乎在通过代码调用时,从LUIS GetResult返回的内容会抛出错误.
LUIS查询在这里
对话框的源代码:
[LuisModel("2d3e39d8-632a-4e00-bf2f-d98ea4b2ed79&", "subscription Key")]
[Serializable]
public class SupportDialog : LuisDialog<object>
{
[LuisIntent("")]
public async Task None(IDialogContext context, LuisResult result)
{
await context.PostAsync("Sorry, I dont understand what you need");
context.Wait(MessageReceived);
}
[LuisIntent("OrderStatus")]
public async Task OrderStatus(IDialogContext context, LuisResult result)
{
var returnMsg = "You wanted to check the order status";
var orderStatus = "Dispatched";
var deliveryDate = DateTime.Now.AddDays(3);
var entities = new List<EntityRecommendation>(result.Entities);
if(entities.Any((entity)=> entity.Type == "Order"))
{
var orderEntity = entities.Where((entity) => entity.Type == "Order").FirstOrDefault();
var …Run Code Online (Sandbox Code Playgroud) c# azure botframework azure-language-understanding azure-cognitive-services
是否可以使用Bot Framework在FormDialog中更改Quit突击队的关键字?
我想在键入某个单词时抛出FormCanceledException(不使用英语作为语言).
如果我可以更改关键字,或者添加另一个与Quit相同的关键字,那将是完美的
我正在尝试从 Web 作业恢复机器人和用户之间的对话,但我收到了未经授权的异常。我可以在 MessagesController 类中成功回复对话,但是当我尝试在 Web 作业中运行以下代码时,出现以下异常:
private static async Task SendAlertToUser(ChannelAccount botAccount, LipSenseUser user, AlertFlags alert, string extra)
{
Console.WriteLine($"Sending alert to user: {user.Name}");
var sb = new StringBuilder(GetTextFromAlert(alert));
if (!string.IsNullOrEmpty(extra))
{
sb.AppendLine();
sb.Append(extra);
}
var userAccount = new ChannelAccount(user.ChannelId, user.Name);
var connector = new ConnectorClient(new Uri(user.ChannelUri));
var message = Activity.CreateMessageActivity();
message.From = botAccount;
message.Recipient = userAccount;
var conversation = await connector.Conversations.CreateDirectConversationAsync(botAccount, userAccount);
message.Conversation = new ConversationAccount(id: conversation.Id);
message.Locale = "en-Us";
message.Text = sb.ToString();
await connector.Conversations.SendToConversationAsync((Activity)message);
}
Run Code Online (Sandbox Code Playgroud)
例外是:
Exception:System.UnauthorizedAccessException …Run Code Online (Sandbox Code Playgroud) 我可以使用cURL来获得令牌,但是Postman还是没有运气。这是curl命令:
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=<your_id>&client_secret=<your_secret>&grant_type=client_credentials&scope=https%3A%2F%2Fapi.botframework.com%2F.default' 'https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token'
Run Code Online (Sandbox Code Playgroud)
按照Microsoft官方文档中有关使用REST开发机器人的说明,我在Postman中发送了一个请求,要求获取oauth令牌以与机器人REST API配合使用。
这是我在Postman中的设置(正在使用Interceptor,因此我可以指定Host):
标头

身体

而且,这是响应:
{
"error": "invalid_scope",
"error_description": "AADSTS70011: The provided value for the input parameter 'scope'
is not valid. The scope https%3A%2F%2Fapi.botframework.com%2F.default is not valid.
\r\nTrace ID: 8b09d0ba-3ec0-4f15-9280-7527d46c1600\r\nCorrelation ID: 43b0fa8f-5b73-444c-
a1e4-9f3dd82c0d86\r\nTimestamp: 2017-05-30 22:17:05Z",
"error_codes": [70011],
"timestamp": "2017-05-30 22:17:05Z",
"trace_id": "8b09d0ba-3ec0-4f15-9280-7527d46c1600",
"correlation_id": "43b0fa8f-5b73-444c-a1e4-9f3dd82c0d86"
}
Run Code Online (Sandbox Code Playgroud)
有谁知道这是什么问题吗?我按照说明进行操作,并且确定客户端ID和机密ID是正确的。在此先感谢您的帮助!
我目前正在构建一个使用BotBuilder SDK在Microsoft Teams中使用的机器人,我在从团队应用程序到机器人选项卡的深层链接方面遇到了一些问题.
我的目标是让机器人发送一条消息,鼓励用户通过单击会话流中发送的链接/按钮来打开机器人的静态选项卡之一.
我已尝试按照创建Microsoft Teams选项卡文档的深层链接,但它似乎只打开一个通用渠道而不是机器人选项卡.
我需要一种在我的 angular 5 应用程序中嵌入网络聊天的方法。我已经尝试过这里描述的非反应网站方式:https : //github.com/Microsoft/BotFramework-WebChat 并且它有效。
有没有办法只使用组件而不是加载整个 js 文件来获取我的 Angualar 5 应用程序中的聊天窗口?
我正在使用最新的bot框架更新.我有两个问题.
我很好奇的第一件事就是初始设置我已经按照README.md的要求将botFilePath和botFileSecret输入到appsettings.json中.一旦我尝试在本地运行它,它似乎无法从appsettings.json读取.我查看了Configuration类变量,但无法弄清楚为什么它无法从我输入的键中获取值.这是代码片段 - 我几乎从https中复制了它: //github.com/Microsoft/BotBuilder-Samples/blob/master/samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddBot<MultiTurnPromptsBot>(options =>
{
var secretKey = Configuration.GetSection("botFileSecret")?.Value;
var botFilePath = Configuration.GetSection("botFilePath")?.Value;
// Loads .bot configuration file and adds a singleton that your Bot can access through dependency injection.
var botConfig = BotConfiguration.Load(botFilePath, secretKey);
Run Code Online (Sandbox Code Playgroud)它失败了 BotConfiguration.Load(...) because botFilePath is null (NullException error).
secretKey和botFilePath从我appsettings.json文件直接进入机器人的代码,然后我得到一个新的错误:System.ArgumentException: 'EncryptedText is not properly formatted'失败在同一个地方.我在应用程序设置下从Azure门户获取了我的密码...我无法找到有关ArgumentException错误的任何信息.有人有什么建议吗?
我有两个用 Java 编写的 Telegram 机器人。
第一个机器人每 10 分钟发送一些消息。(有用)。
第二个机器人必须读取这个发送的消息,并将其存储到 txt 文件中……
但问题是第二个机器人看不到这条消息……
他只能看到来自用户的消息。
M - bot
YR - 用户
聊天图像
控制台结果
BotFather=>Bot=>Settings=>Group Privacy => 禁用隐私模式和>BotFather=>Bot=>Settings=>Allow Groups?=> 群组当前已启用
机器人必须看到从一个发送到另一个的消息。
我做到了,机器人也被邀请到具有管理员权限的新组。
这里的代码示例(第二个机器人):
public class TelegramBot extends TelegramLongPollingBot {
public final String BOT_TOKEN = "****************************";
public final String BOT_NAME = "*****************";
@Override
public void onUpdateReceived(Update update) {
long inChatID = 0;
int inMessID = 0;
String inText = "";
try { // from chanel
inChatID = update.getChannelPost().getChatId();
inText = update.getChannelPost().getText();
inMessID …Run Code Online (Sandbox Code Playgroud) botframework ×10
c# ×5
azure ×2
bots ×2
.net ×1
angular ×1
azure-language-understanding ×1
chatbot ×1
formflow ×1
java ×1
node.js ×1
oauth ×1
telegram ×1
telegram-bot ×1
web-chat ×1