"The bot is not part of the conversation roster" 在 "handleTeamsMessagingExtensionQuery" 中尝试获取用户详细信息时
"The bot is not part of the conversation roster" when trying to get user details in "handleTeamsMessagingExtensionQuery"
我正在开发具有 3 个个人选项卡和消息扩展(搜索命令)的 Teams 应用程序。我需要获取执行搜索的用户的详细信息,方法如下
我正在做 :
async handleTeamsMessagingExtensionQuery(context, query) {
const { aadObjectId } = context.activity.from;
const user = await TeamsInfo.getMember(context, aadObjectId); // Error: The bot is not part of the conversation roster
...
}
这仅适用于机器人“聊天”选项卡中的撰写框,但不适用于群聊或频道中的撰写框。在其他范围内,我得到 The bot is not part of the conversation roster
通过实施 onTeamsMemberAdded(context)
:
,我可以在首次安装应用程序时获取用户详细信息
async onTeamsMembersAdded(context) {
const { aadObjectId } = context.activity.from;
const user = await TeamsInfo.getMember(context, aadObjectId);
console.log("onTeamsMembersAdded " + JSON.stringify(user, null, 2));
}
我尝试以两种方式安装该应用程序:旁加载和发布到我们的组织目录
这是 manifest.json 的 bot 和 composeExtension 道具:
"bots": [
{
"botId": "5159b699-a8c3-4170-ae49-c22ccb76cdfr",
"scopes": [
"personal",
"team",
"groupchat"
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
...
"composeExtensions": [
{
"botId": "5159b699-a8c3-4170-ae49-c22ccb76cdfr",
"canUpdateConfiguration": false,
"commands": [
{
"id": "searchCmd",
"type": "query",
"title": "Search",
"description": "",
"initialRun": false,
"fetchTask": false,
"context": [
"commandBox",
"compose"
],
"parameters": [
{
"name": "searchKeywords",
"title": "Search",
"description": "Search...",
"inputType": "text"
}
]
}
]
}
]
我做错了什么?
botbuilder 版本:4.14.1
清单版本:1.9
为了使其正常工作,您必须先在群聊或频道中安装 bot
。如果您直接访问 Messaging 扩展程序,则它将不起作用。
要获取某个群聊或频道的成员,bot 需要在那里获取这些信息,如果 bot 不在聊天中,它如何获取该信息?希望我说得有道理。
我正在开发具有 3 个个人选项卡和消息扩展(搜索命令)的 Teams 应用程序。我需要获取执行搜索的用户的详细信息,方法如下 我正在做 :
async handleTeamsMessagingExtensionQuery(context, query) {
const { aadObjectId } = context.activity.from;
const user = await TeamsInfo.getMember(context, aadObjectId); // Error: The bot is not part of the conversation roster
...
}
这仅适用于机器人“聊天”选项卡中的撰写框,但不适用于群聊或频道中的撰写框。在其他范围内,我得到 The bot is not part of the conversation roster
通过实施 onTeamsMemberAdded(context)
:
async onTeamsMembersAdded(context) {
const { aadObjectId } = context.activity.from;
const user = await TeamsInfo.getMember(context, aadObjectId);
console.log("onTeamsMembersAdded " + JSON.stringify(user, null, 2));
}
我尝试以两种方式安装该应用程序:旁加载和发布到我们的组织目录
这是 manifest.json 的 bot 和 composeExtension 道具:
"bots": [
{
"botId": "5159b699-a8c3-4170-ae49-c22ccb76cdfr",
"scopes": [
"personal",
"team",
"groupchat"
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
...
"composeExtensions": [
{
"botId": "5159b699-a8c3-4170-ae49-c22ccb76cdfr",
"canUpdateConfiguration": false,
"commands": [
{
"id": "searchCmd",
"type": "query",
"title": "Search",
"description": "",
"initialRun": false,
"fetchTask": false,
"context": [
"commandBox",
"compose"
],
"parameters": [
{
"name": "searchKeywords",
"title": "Search",
"description": "Search...",
"inputType": "text"
}
]
}
]
}
]
我做错了什么?
botbuilder 版本:4.14.1
清单版本:1.9
为了使其正常工作,您必须先在群聊或频道中安装 bot
。如果您直接访问 Messaging 扩展程序,则它将不起作用。
要获取某个群聊或频道的成员,bot 需要在那里获取这些信息,如果 bot 不在聊天中,它如何获取该信息?希望我说得有道理。