1
votes

Not sure if I am missing something but I setup the new Facebook Messenger feature to run on my existing Skype Bot framework and everything works perfectly.

The only issue I am facing is that I cant seem to get the users name who is sending the message to my bot. I have tried the From fields (ID, Address, Name, etc), as well as the participant fields but they all return a number.

Description of what happens.

User logs in to a website and fills out their data and supplies their unique ids for Skype and Facebook which are saved on my backend. Once done they are able to send messages via the bot framework and I pick up who sent the message and respond with details specific to them.

Therefore I need to map the facebook user to my backend user.

I was assuming that the facebook user name would be sent across as most people know what theirs is.

Anyone know where I can get this?

Thanks

2
Thats for the new Facebook messenger bots. I'm looking for the Facebook Messenger add on for the Microsoft Bot Framework link - Jeffrey

2 Answers

0
votes

I took a look at the current code; right now the message that Facebook sends us does not include user name, only the Facebook User Id, so you're giving us what we have (see ChannelData on the Message object).

There is a profile API that we might be able to call as an extra round trip; but for the moment we are not doing so.

0
votes

For each dialog, there's a session object. You can find the user's friendly name under session.message.participants, .to or .from

http://docs.botframework.com/sdkreference/nodejs/interfaces/_botbuilder_d_.imessage.html

If like you said, all you're getting is a "number". That number should be the sender id. You should also see the same number in channelData.sender.id. Try to do a second query to facebook to get the user info. I've tried it and it works.

https://developers.facebook.com/docs/messenger-platform/implementation#user_profile_api