[telegram-bot] How to obtain the chat_id of a private Telegram channel?

update #2 :

Found another one easiest way : Just send to @username_to_id_bot bot your invite link to your private channel, it will return it's ID. Simplest level : maximum! :)

ps. I am not a an owner of this bot.

ps2. To be sure in security, just revoke your old invitation link if it is matter for you after bot using.

Original post :

Make channel public cannot be done by user with exist at least 5 public groups/channels, so...problem not solved. Yes, you can revoke one of them, but for now, we cannot retrieve chat id other way.

revoke

Did anybody found solution for that case?

update

I found crazy solution :

  1. login under your account at web version of Telegram : https://web.telegram.org
  2. Find your channel. See to your url, it should be like https://web.telegram.org/#/im?p=c**1055587116**_11052224402541910257
  3. Grab "1055587116" from it, and add "-100" as a prefix.

So... your channel id will be "-1001055587116". Magic happen :)

Solution found here : https://github.com/GabrielRF/telegram-id#web-channel-id