从Microsoft Bot Framework Channel查找Skype的用户名

我使用Microsoft Bot Framework(版本3.0.0.59)为Skype实现了bot应用程序。

我实现了如何检索Skype名称和ID,但我无法检索Skype帐户的用户名。 我怎样才能获得Skype帐户的用户名?

这是不可能的。 从API的v3版本开始,用户现在由每个bot唯一用户ID表示。 这是为用户提供额外的隐私层(非常像Facebook)。

在MessageActivity的From属性中,您只能找到Id和Name,而不能找到用户名

//Answer if(activity.From.Name != null) string userName= activity.From.Name; //Example public async Task Post([FromBody]Activity activity) { if (activity.Type == ActivityTypes.Message) { string userName= ""; if(activity.From.Name != null) userName= activity.From.Name;//Here we are getting user name ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl)); Activity reply = activity.CreateReply(userName); activity.TextFormat = "markdown"; await connector.Conversations.ReplyToActivityAsync(reply); } else { HandleSystemMessage(activity); } var response = Request.CreateResponse(HttpStatusCode.OK); return response; }