Quick answer:
Every channel is specific and they don't provide a unique way to get information about the user.
You will not have a common information across channels like an email address or an ID, so you will have to build something to do what you want (probably asking the user is the only way...).
Details
More details about what you got in some channels:
- Facebook Messenger:
"from": { "id": "1613014XXXXXXXXX", "name": "My Facebook Name" }
The ID is a PSID
, for Page Scoped ID. It is not the User ID that you have in the URL of the user profile, it is specific to your Facebook Page hosting your bot
- Slack:
"from": { "id": "U54xxxxxx:T53xxxxxx", "name": "nicolas" }
The ID is composed of the concatenation of Slack's User ID and Slack's Team ID. The name is my Slack's username
- Skype:
"from": { "id": "29:1DwlGVzj.....", "name": "My Skype Name" }
This ID is a specific to your bot, it is a hash but the way it is generated is not known (not open-source)
- Skype for Business:
"from": { "id": "nicolas-r@myCompany.com", "name": "My SkypeForBusiness Name" }
Here it is easier...
- Microsoft Teams:
"from": { "id": "29:1ar5DN....", "name": "Nicolas R" }
Here it is similar to what we found on Skype, the ID is an unique ID specific to your bot, it is a hash but the way it is generated is not known (not open-source)
- Twilio SMS:
"from": { "id": "+33600000000", "name": "+33600000000" }
The ID is the phone number of the user
==> As you can see, there is a lot to do to get something unique