简体   繁体   English

如何通过使用 Microsoft Bot Framework 创建的消息扩展上的 ID 获取用户电子邮件?

[英]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.

相关问题 如何在 Microsoft Bot Framework 上通过 ID 获取用户电子邮件? - How to get user email by ID on Microsoft Bot Framework? 如何在Microsoft Bot Framework上获取用户名? - How to get user name on Microsoft Bot Framework? 如何在 Microsoft bot 框架中获取 bot 发送给用户的最后一条消息? 或者是否可以通过连接器 api 更新用户状态? - How to get last message send by bot to user in Microsoft bot framework ? or is it possible to update user state via connector api? 如何使用 Microsoft Graph 客户端作为其他用户从 Microsoft Teams Bot 发送电子邮件? - How to send email from Microsoft Teams Bot using Microsoft Graph Client as a different user? 如何使用Microsoft Bot框架使Bot与Slack中的用户在群组中发起1:1对话? - How to make the bot initiate 1:1 conversation in a group with the user in Slack using Microsoft bot-framework? 如何通过Microsoft Bot Framework中的Skype for Business通道获取用户的身份验证详细信息 - How to get Authentication details of user over Skype for Business channel in Microsoft Bot Framework 如何在Circuit JavaScript SDK中获取向机器人发送消息的用户的电子邮件? - How to get email of user who send message to bot in Circuit JavaScript SDK? Microsoft Bot框架:在连接上发送消息 - Microsoft Bot framework: Sending Message on connect Microsoft Azure Bot Framework SDK 4:使用Node js从机器人向特定用户发送主动消息 - Microsoft Azure Bot Framework SDK 4: Send proactive message to specific users from bot using Node js Microsoft Bot Framework - 在对话期间发送消息 - Microsoft Bot Framework - Sending a message during a dialog
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM