Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 548
codewhiz Avatar asked Jul 15 '18 18:07

codewhiz


People also ask

How long is a Telegram User ID?

The username must be at least five characters long.

Is there a character limit on Telegram?

Telegram messages can currently hold up to 4KB of text (4096 latin characters). It could be possible to allow longer messages with a Show More button to save space in the chat.

Is Telegram user ID unique?

Usernames must be unique across the entire Telegram world, and users, bots, groups, and channels share the same namespace (that is, if a group has username foobar, then a user cannot also have username foobar).


1 Answers

Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

Telegram Bot API#Chat

like image 147
Maak Avatar answered Sep 22 '22 11:09

Maak