Telegram Supergroups/Forums with Topics fetching and building
As Telegram was updated, devs brings some possibility to do a Group with a SubGroups inside it. For now after --build looks like a raw chatlist with date bookmarks... I checked stricture of the template when tg-archive is building a site and found that any subtopic is just a Reply to a root message which seems to be a Head of the Group.
Does smb. make a new template or work on how to build a structure properly when a TG Group has subtopics/subgroups?
- root of the Group (telegram supergroup)
|
-- subGroup 1 (topic 1)
|
-- Subtopic Chat
|-- subGroup 2 (topic 2)
|
-- Subtopic Chat
|--etc...
I believe this is an amazing feature! Been searching for this since the topic was first released!
Gonna go ahead and bump this, can't find a single git solving this problem yet
same Q: bumps here #151 does anyone of Dev/Contributors are here alive to discuss how to update code or build a plugin for this feature? it's useful very
Telegram named it as Forums in the Supergroup class.
so, the tg-archive fetching is working well except on some errors time to time..
but --build implementation and http rendering should to be updated to support this...
the key to understanding this is here:
Every forum has a non-deletable "General" topic, with id=1; other topics will have other IDs, equal to the [messageActionTopicCreate](https://core.telegram.org/constructor/messageActionTopicCreate) service message that created the topic.
To send messages to the "General" topic, just use [messages.sendMessage](https://core.telegram.org/method/messages.sendMessage) as usual, as if you were writing to a normal supergroup.
On the other hand, topics with id != 1 are just the [message thread](https://core.telegram.org/api/threads) of the [messageActionTopicCreate](https://core.telegram.org/constructor/messageActionTopicCreate) service message that created that topic.
This means that topics should be treated similarly to [message threads](https://core.telegram.org/api/threads) by the client.
To send messages to these topics, pass the topic ID to the reply_to_msg_id parameter of [inputReplyToMessage](https://core.telegram.org/constructor/inputReplyToMessage), passed to reply_to when invoking [messages.sendMessage](https://core.telegram.org/method/messages.sendMessage), [messages.sendMedia](https://core.telegram.org/method/messages.sendMedia) et cetera.
The fetching also must be reworked.
Actually no information about the topics (names and so) is stored in the SQLite database. Also it's not stored which messages was posted in which topic.
So the fetching needs to check if a "group" is a normal group, channel or forum. In case of a forum it must also store the additional information in the database.
The rendering then just needs an additonal level for forums.