I need to ask the user for his/her phone number. I couldn't find an API to do it, so I'm using sourceEvent, like this:
builder.Prompts.text(session, new builder.Message(session).sourceEvent({
telegram: {
method: "sendMessage",
parameters:
{
text: "Text Ciao",
reply_markup: {
keyboard: [[{ text: "Send me your info", request_contact: true, }]]
}
}
}
}))
But where should I look to find what the user sent me?
results.response is always empty.
Hi ziggy42. I believe the reply will come in on message.sourceEvent, but I will verify this and get back to you. Let me also ask: is your keyboard displaying in Telegram? I ask because the reply_markup field must be serialized JSON, e.g.
reply_markup: JSON.serialize({
keyboard: [[{ text: "Send me your info", request_contact: true, }]]
});
Hi, yeah I see the keyboard and works just fine.
I've also already tried to look in session.message.sourceEvent but I don't see the phone number, only the name of the user
I'm doing the same in C#, and it seems that not only request_contact is having this issue, but sending any contact results in a blank message.
@eanders-MS any follow up on this? The contact info should be in the source event right?
It looks like we weren't supporting Telegram's contact field. I've corrected this problem and the fix will go live in the next production deployment. We update production every week or so. I will drop a note here when we make the next update. If you're still experiencing this issue after that time please reply here and we'll continue to troubleshoot.
Most helpful comment
It looks like we weren't supporting Telegram's contact field. I've corrected this problem and the fix will go live in the next production deployment. We update production every week or so. I will drop a note here when we make the next update. If you're still experiencing this issue after that time please reply here and we'll continue to troubleshoot.