Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Telegram Bot Super Group ID?

How to get Telegram Bot Super Group ID?

With This Code:

bot.on('message', (msg) => {
  console.log(msg);
});

I Can See my Private Channel ID in forward_from_chat: { id: -1001125265425, of the object, That is Okey.
But How Can I Get Super Group ID?

like image 548
Saeed Heidarizarei Avatar asked Oct 23 '25 14:10

Saeed Heidarizarei


1 Answers

First of all, you should add a bot to that group.

Then if the group is public (has @username), just send message to the group and read reply from Telegram server, it will be of type Message, and Message->Chat->Id is group's ID.

If the group is private (doesn't have a @username), then you can mention a bot in your message and, again, read reply from Telegram server.

Or you can use some third-party bots, for example, @my_id_bot, which I made specifically for this.

like image 181
Groosha Avatar answered Oct 26 '25 10:10

Groosha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!