在消息扩展处理程序中获取teamId

编程入门 行业动态 更新时间:2024-10-22 09:40:16
本文介绍了在消息扩展处理程序中获取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

本文发布于:2023-10-13 00:03:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486246.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:消息   程序   teamId

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!