Hey everyone! I’m working on a small project where I need to quickly get the chat IDs for a bunch of phone numbers in Telegram. Does anyone know if there’s a fast way to do this with a Telegram bot? I’ve been scratching my head trying to figure out the best approach. It would be super helpful if someone could point me in the right direction or share any tips they might have. Thanks in advance for any help!
Having worked with Telegram bots, I can confirm that directly retrieving chat IDs from phone numbers isn’t allowed because of Telegram’s privacy policies. An effective approach is to design your bot so that it requests user interaction. When a user sends a message, for instance after issuing the /start command, the bot can capture that user’s chat ID. In practice, I integrated a system where the bot prompts for a phone number after the initial interaction, then stores the pair. This method complies with Telegram’s terms of service while ensuring user consent.
hey there! i’ve messed around with telegram bots before, and sadly you cant just grab chat IDs from phone numbers - telegram doesn’t allow it for privacy reasons. but heres a trick: make your bot ask users to send a specific message. when they do, you can snag their chat ID. maybe have them include their phone number in the message to link em up. its not perfect but works and follows telegrams rules!
As someone who’s implemented Telegram bots before, I can tell you that directly fetching chat IDs from phone numbers isn’t possible due to Telegram’s privacy policies. However, there’s a workaround I’ve used successfully. Create a bot that prompts users to send a specific command or message. When they do, you can capture their chat ID. To link this with phone numbers, you could ask users to send their phone number as part of the interaction. Store these pairs in a database. This method respects Telegram’s rules and users’ privacy. It requires some extra steps, but it’s reliable and compliant with Telegram’s terms of service.