我有一个使用ms bot v3 nodejs构建的机器人。我在我的MS团队中添加了这个机器人,使用深层链接进行1:1会话,如下所示
https://teams.microsoft.com/l/chat/0/0?users=28:{BotID}
我想在这个机器人中添加@--提到用户的功能--我想看看我是否能得到一些关于如何实现的例子?
不确定是否侧加载机器人作为一个应用程序将允许它。
发布于 2018-09-28 19:28:34
机器人和用户只能提到同一对话的成员。
现在,无论是机器人还是用户,都不能提及不属于对话成员的任意用户。
上面的示例"Hello @PersonB和@PersonC请注意此票证“,如果PersonB和PersonC是团队的一部分(如果这是在通道中),或者是集体聊天,而不是在与机器人的1:1聊天中,则可以工作。
您问题中的深度链接创建了一个1:1的聊天/机器人,因此其他用户都无法访问:(
发布于 2018-09-25 04:35:00
单个用户会话中的机器人不需要@ type -用户只需键入命令即可。频道对话中的机器人要求用户在通道中@提到机器人来调用它。
为了将您的bot访问到通道中,您需要在App报表中为您的bot添加团队范围。请使用Teams App Studio创建应用程序清单。您需要将应用程序包上载到Microsoft团队来查看您的应用程序。
发布于 2018-09-25 10:30:46
你可以上传你的机器人作为一个应用程序,为此,你需要创建一个像这样的JSON格式的应用清单。
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.3.0-beta.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.3",
"version": "1.3",
"id": "c9edb618-c5de-4be2-**f4-74c1*******1",
"packageName": "com.example.tcafebot",
"developer": {
"name": "Harsh Raj",
"websiteUrl": "https://www.sdharshraj.github.io",
"privacyUrl": "https://privacy.microsoft.com/en-us/privacystatement",
"termsOfUseUrl": "https://www.botframework.com/Content/Microsoft-Bot-Framework-Preview-Online-Services-Agreement.htm"
},
"name": {
"short": "TCafeBot",
"full": "Tea and Coffee bot"
},
"description": {
"short": "TCafeBot - a bot helping you with twiter.",
"full": "It will help you find a user or tweets from twiter. Also it can read text from image or even it can tell what is there in a photo."
},
"icons": {
"outline": "bot_blue.png",
"color": "bot_blue.png"
},
"accentColor": "#0079bf",
"configurableTabs": [{
"configurationUrl": "https://contoso.com/teamstab/configure",
"canUpdateConfiguration": true,
"scopes": [
"team",
"groupchat"
]
}],
"staticTabs": [{
"contentUrl": "https://harshcognitivebot.azurewebsites.net/loading",
"entityId": "1on1test123",
"name": "Bot Info",
"scopes": [
"team",
"personal"
]
},
{
"contentUrl": "https://harshcognitivebot.azurewebsites.net/tab-auth/simple",
"entityId": "simpleAuth",
"name": "Simple Auth",
"scopes": [
"personal"
]
},
{
"contentUrl": "https://harshcognitivebot.azurewebsites.net/tab-auth/silent",
"entityId": "silentAuth",
"name": "Silent Auth",
"scopes": [
"personal"
]
}
],
"bots": [{
"botId": "c9edb618-c5de-4be2-**f4-74c1*******1",
"scopes": [
"team",
"personal",
"groupchat"
],
"commandLists": [{
"scopes": [
"team"
],
"commands": [{
"title": "hello",
"description": "Runs the simplest hello dialog"
}
]
},
{
"scopes": [
"personal"
],
"commands": [{
"title": "hello",
"description": "Runs the simplest hello dialog"
}
]
}
]
}],
"composeExtensions": [{
"botId": "c9edb618-c5de-4be2-**f4-74c1*******1",
"canUpdateConfiguration": true,
"commands": [{
"id": "search123",
"description": "Find a card",
"title": "Search",
"initialRun": true,
"parameters": [{
"title": "query123",
"name": "query",
"description": "Search string"
}]
}]
}],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"787c30bb.ngrok.io"
]
}
并保留一个图标,并在Manifest文件中给出名称。
然后,您需要对这两个文件(Manifest和Icon)创建一个zip文件。请注意,这两个文件不应该在任何文件夹中,您应该直接使用这两个文件进行压缩。
然后转到Team并选择上传一个自定义应用程序,您可以在那里浏览您的zip文件。
另外,要获取团队详细信息,可以参考此链接
https://stackoverflow.com/questions/52489964
复制相似问题