我想问一下如何正确使用缩略图卡片按钮。我希望按钮使用context.Wait(methodName)专门调用一个新方法。 现在我有缩略图卡按钮验证码:Thumb context Card.Wait()
thumbnailCard.Buttons = new[] {new CardAction(
ActionTypes.MessageBack, $"Account", value: id
)};
var msg = context.MakeMessage();
msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
msg.Attachments = cardAttachment.ToList();
await context.PostAsync(msg);
context.Wait(methodName); **I want this to be called when button was clicked**
但显然我不能开除每当我点击按钮的方法。 PS:我实际上是新的bot框架,所以任何帮助将不胜感激。谢谢。
注意:可能的重复不是我遇到的问题。我不是通过thumbnail.Buttons调用一个方法,而是我插入需要传递到另一个方法使用context.Wait(MethodName)
的值,但我们有如何正确实现它的相同方法,但它不回答为什么我的问题无法启动我插入上下文的方法。等等。
您必须将您想要调用的方法放在MessageReceived方法上,并检查您接收到的值(该值应与您在CardAction中传递的值相匹配) –
可能的[如何调用特定回调函数点击Card Action - Bot Framework](https://stackoverflow.com/questions/40808192/how-to-call-a-specifc-callback-when-clicking-in-card-action-bot-framework) –
@NicolasR我已经尝试过,但它没有在我的最终结果。 –