我正在寻找一种将机器人添加到该机器人刚刚创建的团队的方法。
- 能够通过 bot JS-SDK 通过 MS Graph 创建一个组
graphClient.api("/groups").post({
displayName: "Some Name",
mailNickname: "Name without Spaces",
description: "Some Description",
visibility: "Private",
groupTypes: ["Unified"],
mailEnabled: true,
securityEnabled: false,
"members@odata.bind": members, // array of url strings of members
"owners@odata.bind": owners,
});
members
和owners
代表用户的字符串数组:
https://graph.microsoft.com/v1.0/users/{user-id}
. /users
通过搜索找到它们
- 然后将一个团队添加到该组(来源:https ://docs.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-beta&tabs=javascript ),如下所示:
graphClient.api(`/groups/${group-id}/team`).put({});
- 和渠道 -
graphClient.api(`/teams/${group-id}/channels`).post(channel);
找不到将机器人添加到刚刚创建的团队或频道的方法。也许有一种方法可以找到它 guid 或某种 app-id 并将其添加到组中?