skip to Main Content

Is it possible for telegram bots to obtain the user’s phone number after they have started the bot (without explicitly asking the user to input their contact details)?

If so, how do I achieve this using Telegram bot api or any other method?

2

Answers


  1. For privacy reasons, it’s absolutely impossible.

    These are everything that bot knows about a user:

    Field Type
    id Integer
    is_bot Boolean
    first_name String
    last_name String
    username String
    language_code String
    can_join_groups Boolean
    can_read_all_group_messages Boolean
    supports_inline_queries Boolean

    https://core.telegram.org/bots/api#user

    Login or Signup to reply.
  2. I found your asking randomly

    You must send user KeyboardButton, but Button must have option "request_contact" = true.

    Screenshot from docs

    https://core.telegram.org/bots/api#keyboardbutton

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search