Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatByUsername queries by ID, not by username #750

Closed
zewebdev1337 opened this issue Oct 18, 2024 · 1 comment
Closed

ChatByUsername queries by ID, not by username #750

zewebdev1337 opened this issue Oct 18, 2024 · 1 comment

Comments

@zewebdev1337
Copy link

bot.ChatByUsername queries the API with the chat_id instead of username, not sure what happened there because I see the function defined above (ChatByID), converts its int64 ID to a string and then calls ChatByUsername with it.

@zewebdev1337
Copy link
Author

zewebdev1337 commented Oct 23, 2024

After checking the official API documentation it seems like we can only query users by ID, it might seem ambiguous as it mentions usernames too but only for channels and supergroups...

From the official API docs:

getChat

Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.

Parameter Type Required Description
chat_id Integer or String Yes Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

For my usecase, I wanted to query users by username, not channels or supergroups.

However I'm going to try to query it with a username since it's not rare for docs to go out of date, especially for such a big project as the Telegram bot API. If I succeed I'll report it here and contribute by making the necessary changes, however if I don't succeed I'll just close this as not planned.

@zewebdev1337 zewebdev1337 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant