5

When I'm receiving the message from Telegram, I get detailed information about account in Activity.ChannelData field (such as username, conversation_id and so on).

{
  "update_id": ,
  "callback_query": {
    "id": "",
    "from": {
      "id": ,
      "is_bot": false,
      "first_name": "",
      "last_name": "",
      "username": "",
      "language_code": ""
    },
    "message": {
      "message_id": ,
      "from": {
        "id": ,
        "is_bot": true,
        "first_name": "",
        "username": ""
      },
      "chat": {
        "id": ,
        "first_name": "",
        "last_name": "",
        "username": "",
        "type": "private"
      },
      "date": ,
      "text": "Example text"
    },
    "chat_instance": "",
    "data": ""
  }
}

But when it comes to Skype, all I see is the message text and nothing else.

{  "text": "Example text"}

How to know out, who exatly sent me the message?

Upd: That should not be exactly the user's name, any additional data like user unique id would fit.

Liam Kernighan
  • 2,335
  • 1
  • 21
  • 24
  • Possible duplicate of [Find Username of skype from Microsoft Bot Framework Channel](https://stackoverflow.com/questions/40503468/find-username-of-skype-from-microsoft-bot-framework-channel) – Steven Kanberg Sep 19 '18 at 17:27
  • 1
    you do not need to pull this data from channel data, the activity object will have the user's id in the `activity.from.id` or `activity.recepient.id` field depending on which direction the message is going. Every channel's channel data is different. – D4RKCIDE Sep 27 '18 at 15:44
  • @JasonSowers thank you so much. I should've explored activity object more carefully. – Liam Kernighan Sep 27 '18 at 18:55
  • @StevenKanberg D4RKCIDE gave the right answer above. You can clear your answer from your support tracker. – Liam Kernighan Jun 06 '19 at 22:29

1 Answers1

2

Unfortunately, what is returned is channel specific, as determined by the channel developers. It is not a function of the Azure Bot Service or Bot Framework that determines this.

As for knowing who sent a message, this is not possible. Skype only returns a unique id per user in order to provide a layer of confidentiality with respect to privacy concerns.

Steven Kanberg
  • 6,078
  • 2
  • 16
  • 35