Search code examples
telegramtelegram-botpython-telegram-botphp-telegram-botlua-telegram-bot

How much length can be of a Telegram user_id?


I am making a database in which my algorithm only accepts queries from users with telegram id length of 9.

user_id: 123456789;
length = user_id.length;
display(length);

OUTPUT: 9

Are there telegram user ids of length lesser than 9?
Can anybody suggest something, so that i can update my algorithm to length of that ids too.


Solution

  • You can refer to Contact section of API document.

    it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.


    2018 (Outdated):

    There have no known limit of user ID, but I know there have some user have less than 9 digits ID.

    For instance, @MarkusRa have 6-digits ID.

    The maximum length I have seen is 9 digits, and starts with 6, it seems to increase by time, maybe it will have 10 digits soon