How to get a list of all the telegram groups I have joined?

Viewed 12354

I want to get the list of telegram groups(name) which I am a part of. Like a text file or something else. How can I do that?

2 Answers

I had the same question here, so I started searching and found no proper answer. Then I came over this question and since it had no answers, it triggered me to search more and write an answer.

According to what Telegram document says here and here:

messages.getAllChats

Get all chats, channels and supergroup

apparently getAllChats gives you all ChatIds. You can pass chatIds to another API to get chat name and more info.

Also, if you want to get the list of chats you administrate, use the following API:

channels.getAdminedPublicChannels

Get channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the limit for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups.

I just don't like (or maybe understand) the way they documented their APIs. I wish it was something more familiar, more HTTP-like.

Another way - use web-version of the telegram and parse HTML. Here are steps:

  • create folder with only groups;
  • go to web-version, open this folder;
  • run code copy($$(".dialog-title .peer-title").map(function(e){return e.textContent})) in console, it will copy title of groups on screen into clipboard;
  • if you have a lot groups on several screens, list groups below and make previous step again;
  • join all the groups into one big list;
  • profit!
Related