【问题标题】:Microsoft teams task module bot framework , submit task handler is not workingMicrosoft 团队任务模块机器人框架,提交任务处理程序不起作用
【发布时间】:2021-06-21 17:08:54
【问题描述】:

任务模块没有关闭,也没有返回机器人。 在我的 Customform.html 中

 async componentDidMount() { 
const { headers, } = this.state;
 microsoftTeams.initialize(); 
 microsoftTeams.getContext((context, error) => {
this.setState( { context: context, }, () => { console.log( "this.state.context in upn is ", this.state.context["upn"] ); } ); }); }

提交处理程序

     microsoftTeams.initialize();
     if ( reservationResponse.status && reservationResponse.status === 400 ) {
 this.setState({ showErrorMessage: true, loading: false, disableButton: false, }); } 
else { this.setState({ loading: false, });
     microsoftTeams.tasks.submitTask( reservationResponse, "bot-id" ); 
return true;

bot id 正确且有效域列表中的 url。 我已经尝试了所有可能的组合,但它根本不在handleTeamsTaskModuleSubmit 函数中。

【问题讨论】:

  • 让我检查一下这个问题,并会回复你。

标签: node.js botframework microsoft-teams microsoft-graph-teams


【解决方案1】:

componentDidMount() 是一个在 html 文件中不起作用的反应组件。如果您想在 html 文件中调用 getContext(),您需要遵循以下代码格式。

    <script>

microsoftTeams.initialize();

microsoftTeams.getContext(function (context){console.log(context.entityId)});

</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-06
    • 1970-01-01
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-27
    相关资源
    最近更新 更多