我目前正在尝试使用botframework和LUIS Build 一个聊天机器人 .

LUIS有一个免费帐户,每月包含10,000个电话 . 超过此限制时,应用程序会收到“403 Quota Exceeded”错误 .

目前机器人正在回答错误,我希望它忽略,并在发生错误时不回复 .
enter image description here

我几乎使用BotBuilder示例代码:https://github.com/Microsoft/BotBuilder/tree/master/CSharp/Samples/SimpleEchoBot

MessageController Post 操作中添加通用try / catch不能解决问题 .

[ResponseType(typeof(void))]
public virtual async Task<HttpResponseMessage> Post([FromBody] Activity activity)
{
    // check if activity is of type message
    if (activity != null && activity.GetActivityType() == ActivityTypes.Message)
    {
        try
        {
            await Conversation.SendAsync(activity, MakeRoot);
        }
        catch (Exception ex)
        {
            System.Diagnostics.Trace.TraceError(ex.Message);
        }
    }
    else
    {
        HandleSystemMessage(activity);
    }
    return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);
}

internal static IDialog<object> MakeRoot()
{
    return Chain.From(() => new DefaultDialog());
}

DefaultDialog 正在继承 LuisDialog<T> 类 .

[LuisModel("---", "---", domain: "westeurope.api.cognitive.microsoft.com")]
[Serializable]
public class DefaultDialog : LuisDialog<object>
{
    [LuisIntent("")]
    public async Task None(IDialogContext context, LuisResult result)
    {
        context.Wait(MessageReceived);
    }
    ...
}

错误被抛出,我能够 grab 它但机器人仍然会回答 .