botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Telegram - message.user.name is not set

Open pcostantini opened this issue 10 years ago • 3 comments

Hi! I'm using session.message.user.name to display the user's name. Through the Telegram channel, the name field is not set in the user object. It seams that the incoming message to the Bot API endpoint is not including the name field in the from object. Other channels are including this field.

BTW, the same occurs with the C# SDK.

Incomming Message to API Messages endpoint image

The same is ocurring in C#: image

A workaround in the meantime is to use sourceEvent.callback_event.from.first_name when the message comes from Telegram: image

Should this be considered an SDK bug or an API bug? Thanks in advance! PabloC.

pcostantini avatar Sep 22 '16 21:09 pcostantini

The Telegram user's username is sent in this field, if provided. Telegram usernames are optional. This is a privacy feature of Telegram. You can set your username in the Settings section of Telegram.

Read more about Telegram usernames here: https://telegram.org/faq#usernames-and-telegram-me

eanders-ms avatar Sep 22 '16 21:09 eanders-ms

That was it! Thanks @eanders-MS !

pcostantini avatar Sep 22 '16 22:09 pcostantini

@pcostantini So, there's no way to get the username if the user didn't set it already?

Nisthar avatar May 12 '17 06:05 Nisthar