在消息扩展处理程序中获取teamId [英] Get teamId in message extension handler

查看:60
本文介绍了在消息扩展处理程序中获取teamId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在为Microsoft Teams开发消息扩展时,是否可以在用户不首先将漫游器添加到该团队的情况下检索用户正在调用message extension命令的团队的ID?

When developing a message extension for Microsoft Teams, is it possible to retrieve the ID of a team where the user is invoking the message extension command without first adding the bot to that team?

当机器人根据 TeamsInfo.getTeamDetails()手动添加到团队中时,我可以执行此操作,但是,我并不需要(或想要)将机器人添加到团队中为了我的目标我需要的只是渠道ID(可从上下文/会话中获得)和基础团队的ID.检索团队详细信息,而无需事先向机器人添加机器人不是对话名册的一部分"的错误.

I can do this when the bot is added to the team manually based on TeamsInfo.getTeamDetails(), however, I don't really need (or want) to add the bot to the team for my goal. All I need is the channel ID (which is available from the context/conversation) and the ID of the underlying team. Retrieving the team details without the bot being added beforehand errors with "The bot is not part of the conversation roster".

推荐答案

看看Activity类的ChannelData属性,它应该可以满足您的需求.您可以阅读有关它的更多信息此处.

Have a look at the ChannelData property on the Activity class, that should give what you need. You can read more about it here.

下面是一个有趣的底层有效负载示例:

Here's an example of the underlying payload, for interest:

"channelData":{"eventType":"channelCreated","tenant":{"id":"72f988bf-86f1-41af-91ab-2d7cd011db47"},频道":{"id":"19:693ecdb923ac4458a5c23661b505fc84@thread.skype",名称":我的新频道"},"team":{"id":"19:693ecdb923ac4458a5c23661b505fc84@thread.skype"}}

这篇关于在消息扩展处理程序中获取teamId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆