Task模块中Input.ChoiceSet联想搜索无法触发onInvokeActivity求助
Task模块中Input.ChoiceSet无法触发onInvokeActivity,返回504错误
在Teams的Task模块内使用Input.ChoiceSet组件时,选择选项后无法触发onInvokeActivity方法。该问题数月前已提交给微软团队,但尚未得到解决时间节点的回复。
以下是相关代码示例及错误信息,恳请有同类问题解决经验的开发者提供帮助:
自适应卡片示例代码
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.4", "body": [ { "type": "Input.ChoiceSet", "id": "choiceInput", "choices": [ { "title": "选项1", "value": "opt1" }, { "title": "选项2", "value": "opt2" } ], "placeholder": "请选择" } ], "actions": [ { "type": "Action.Submit", "title": "提交" } ] }
onInvokeActivity方法代码
protected override async Task<InvokeResponse> OnInvokeActivityAsync(ITurnContext<IInvokeActivity> turnContext, CancellationToken cancellationToken) { if (turnContext.Activity.Name == "task/submit") { var data = JsonConvert.DeserializeObject<JObject>(turnContext.Activity.Value.ToString()); // 处理提交逻辑 return new InvokeResponse { Status = 200, Body = new { task = new { type = "message", value = "提交成功" } } }; } return await base.OnInvokeActivityAsync(turnContext, cancellationToken); }
触发时的错误信息
当选择Input.ChoiceSet选项并提交时,网络请求返回以下错误:
{"statusCode":504,"message":"App is not installed"}
内容的提问来源于stack exchange,提问作者Yogendra
相关产品推荐
相关产品推荐

