Is Telegram username unique?
Asked Answered
N

1

5

When I work over bot development, I found that messages that comes from user have some field called username, e. g.

{
    update_id: 123567890,
    message: {
        message_id: 1,
        from: {
            id: 1234567890,
            is_bot: false,
            first_name: "Kappa",
            last_name: "Pride",
            username: "kappapride",
        }
    ...
}

Does this field contains an unique value, such as id field? I know, I can make a TG link with it (like @kappapride), but I'm not sure if this field presents for each TG user.

Norge answered 25/6, 2018 at 10:50 Comment(0)
S
8

Only one user can have @kappapride (I believe channels and groups can also take it) username at the same time but users can change their username at any time so no, it's definitely not fine to consider it as unique identifier for users.

Skindive answered 25/6, 2018 at 11:32 Comment(1)
Thank you, you have completely answered my question!Norge

© 2022 - 2025 — McMap. All rights reserved.