ReplyToId'不能为null

Inf*_*oom 2 botframework

这种例外不断抛出.这是因为我将botframework更新为3.5.3.

代码:

MessagesController:

 await Conversation.SendAsync(activity, () => new DefaultDialog());
Run Code Online (Sandbox Code Playgroud)

比我的DefaultDialog:

 private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
        {
            var msg = await argument;


await Helper.CallMenu(context, msg);
Run Code Online (Sandbox Code Playgroud)

在CallMenu函数中:

internal static async Task CallMenu(IDialogContext context, IMessageActivity msg)
{
    await MenuFirstPart(context, msg);
Run Code Online (Sandbox Code Playgroud)

在MenuFirstPart函数中:

 internal static async Task MenuFirstPart(IDialogContext context, IMessageActivity msg)
        {
            await context.PostAsync("I can assist you with : ");


            msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
            msg.Attachments = new List<Attachment>();


            ThumbnailCard thumbnailCard = new ThumbnailCard()
            {
                Buttons = new List<CardAction>
                        {
                         new CardAction ()
                            {
                                Value = "Method_News",
                                Type = "postBack",
                                Title = "News"
                            },
                            new CardAction()
                            {
                                Value = "Method_About",
                                Type = "postBack",
                                Title = "About"
                            },
                            new CardAction ()
                            {
                                Value = "Method_Help",
                                Type = "postBack",
                                Title = "Help"
                            },
                        },

            };
            msg.Attachments.Add(thumbnailCard.ToAttachment());
            await context.PostAsync(msg);
        }
Run Code Online (Sandbox Code Playgroud)

当上下文试图发布消息时抛出异常.

有帮助吗?或者如何将我的机器人降级到3.5.0.这在那里工作得很好......

Eze*_*dib 5

您正在使用传入消息(msg)并将其发回.

您需要创建一条新消息.使用以下内容:

var reply = context.MakeMessage();
Run Code Online (Sandbox Code Playgroud)