2017-06-29 14 views
1

グループの会話に追加できるskypeBotを作成しました。ボットがどのように会話から参加者のリストを得ることができるかについての方法はありますか?ボットをグループの会話の参加者またはメンバーに一覧表示/取得させるにはどうすればよいですか?

+0

関連:あなたは次の操作を行うことができますC#コードからそうhttps://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-GetConversationMembers

はここにも詳細を参照してください。 https://github.com/Microsoft/BotBuilder/issues/2992 – JasonSowers

+0

.netまたはnodeも使用していますか? – JasonSowers

+0

@JasonSowers提供されているリンクには、MSチームの応答しかありません。 –

答えて

0

ありスカイプでのボットグループの会話の参加者を取得するには、少なくとも2つの方法がありますが、あなただけそのIDを取得します:

ケース1:を上げてConversationUpdateメッセージをチェックすることにより、会話を作成する。 (私のボットの一つで作られた)

サンプル:29:1AE5BB....29:1DwlGVz...:ここ

{ 
    "type": "conversationUpdate", 
    "id": "f:6c9b7aa2", 
    "timestamp": "2017-06-30T11:40:09.3Z", 
    "localTimestamp": null, 
    "serviceUrl": "https://smba.trafficmanager.net/apis/", 
    "channelId": "skype", 
    "from": { 
     "id": "29:1AE5BB....", 
     "name": null 
    }, 
    "conversation": { 
     "isGroup": true, 
     "id": "19:[email protected]", 
     "name": null 
    }, 
    "recipient": { 
     "id": "28:myBotAppId", 
     "name": "myBotName" 
    }, 
    "textFormat": null, 
    "attachmentLayout": null, 
    "membersAdded": [{ 
     "id": "29:1AE5BB...", 
     "name": null 
    }, { 
     "id": "29:1DwlGVz...", 
     "name": null 
    }, { 
     "id": "28:myBotAppId", 
     "name": null 
    }], 
    "membersRemoved": [], 
    "topicName": null, 
    "historyDisclosed": null, 
    "locale": null, 
    "text": null, 
    "speak": null, 
    "inputHint": null, 
    "summary": null, 
    "suggestedActions": null, 
    "attachments": [], 
    "entities": [], 
    "channelData": null, 
    "action": null, 
    "replyToId": null, 
    "value": null, 
    "name": null, 
    "relatesTo": null, 
    "code": null 
} 

あなたはmembersAddedブロックでグループ会話にいる2人のユーザーを持っています。最後のIDは、ボットID

ケース2:です。APIをリクエストしてください。 https://smba.trafficmanager.net/apis/v3/conversations/yourConversationId/membersにGETリクエストを行うことができ、同じ2つのIDを取得します。

ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl)); 
var members = connector.Conversations.GetConversationMembersWithHttpMessagesAsync(activity.Conversation.Id).Result.Body; 
+0

これらのIDでユーザーの情報を取得する方法はありますか?利用可能であれば、名字と姓を得ることができます。 –

0

C#の場合は、あなたがmessageControllerでこれを試すことができ

ConnectorClient connector = new ConnectorClient(new System.Uri(activity.ServiceUrl)); var members = connector.Conversations.GetConversationMembersWithHttpMessagesAsync(activity.Conversation.Id).Result.Body;

+0

あなたは正しいですこの方法は私のCase2のカプセル化です、私はケースにそれを追加しました! –

関連する問題