[英]How to get user email by ID on Message extension created using Microsoft Bot Framework?
I am using Microsoft Bot Framework to create a message extension.我正在使用 Microsoft Bot Framework 创建消息扩展。 I would like to get the user email of customers who enter the search query in the command box.
我想获取在命令框中输入搜索查询的客户的用户电子邮件。 I am able to get the user email id in the normal search, ie in the bottom search and chatbox.
我能够在正常搜索中获取用户电子邮件 ID,即在底部搜索和聊天框中。 But the same method is not working when I search the content using the command box by entering @appname .
但是,当我通过输入 @appname 使用命令框搜索内容时,相同的方法不起作用。 The following method is used to get the user email id in a normal search
以下方法用于获取普通搜索中的用户email id
export default class MessageExtension extends TeamsActivityHandler {
async handleTeamsMessagingExtensionQuery(context, query) {
let searchQuery = query.parameters && query.parameters[0].name === 'query'
? query.parameters[0].value
: '';
console.log("searchQuery="+searchQuery);
console.log("query="+JSON.stringify(query));
const member = await this.getTeamMember(context);
console.log("email="+member);}}
async getSingleMember(context) {
try {
const member = await TeamsInfo.getMember(
context,
context.activity.from.id
);
var email = member.email;
const message = MessageFactory.text(`You are: ${member.email}`);
return email
} catch (e) {
if (e.code === 'MemberNotFoundInConversation') {
return context.sendActivity(MessageFactory.text('Member not found.'));
} else {
throw e;
}
}}
Does anyone know how we can get it?有谁知道我们怎样才能得到它?
Screenshot of the command box search area命令框搜索区域的屏幕截图
This is a platform bug.这是一个平台错误。 We have raised a request to fix it.
我们提出了修复它的请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.