Can I get a phone number by user id via Telegram Bot API?

前端 未结 2 1971
醉酒成梦
醉酒成梦 2021-01-01 23:54

I am using Telegram Bot API for sending instant messages to users. I have installed nuget package. This package is recommend by telegram developers.

I ha

相关标签:
2条回答
  • 2021-01-02 00:10

    It's possible with bots 2.0 check out bot api docs.

    https://core.telegram.org/bots/2-0-intro#locations-and-numbers https://core.telegram.org/bots/api#keyboardbutton

    0 讨论(0)
  • 2021-01-02 00:24

    No, unfortunately Telegram Bot API doesn't return phone number. You should either use Telegram API methods instead or ask it explicitly from the user. You cannot get "friends" of a user as well.

    You will definitely retrieve the following information:

    1. userid
    2. first_name
    3. content (whatever it is: text, photo, etc.)
    4. date (unixtime)
    5. chat_id

    If user configured it, you will also get last_name and username.

    0 讨论(0)
提交回复
热议问题