通过添加以下代码来打开内容主持人:
Use(new ContentModeratorMiddleware(settings.ContentModerator.Key, contentModeratorSettings.Value.Region)); to the defaultAdapter.cs.
出现此错误:
at System.Text.Encoding.GetBytes(String s)
at Microsoft.Bot.Builder.Solutions.Middleware.ContentModeratorMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AutoSaveStateMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\AutoSaveStateMiddleware.cs:line 60
at Microsoft.Bot.Builder.Solutions.Middleware.EventDebuggerMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.Solutions.Middleware.SetLocaleMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.ShowTypingMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\ShowTypingMiddleware.cs:line 71"
这发生在触发器之前:
protected override async Task OnEventAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken))