Skip to content

Commit

Permalink
doc for topics & v22.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz0u committed Dec 9, 2024
1 parent 5b30a56 commit ed70afa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
18 changes: 17 additions & 1 deletion src/2/chats.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Here are a few interesting ones:
- Description
- default Permissions _(non-administrator access rights)_
- Linked ChatId _(the associated channel/discussion group for this chat)_
- IsForum _(This chat group has topics. There is no way to retrieve the list of topics)_
- IsForum _(This chat group has [topics](#forum--topics))_
* Common information for all chats:
- Photo _(use `GetInfoAndDownloadFile` and the `photo.BigFileId` to download it)_
- Active Usernames _(premium user & public chats can have multiple usernames)_
Expand Down Expand Up @@ -116,3 +116,19 @@ The more complex (and more reliable) approach is instead to handle updates of ty
* Typically, you would pass `Update.AllTypes` as the allowedUpdates parameter.
* After that, you will receive an `update.ChatMember` structure for each user changing status with their old & their new status
* The `OldChatMember`/`NewChatMember` status fields can be one of the derived `ChatMember*` class: `Owner`/`Creator`, `Administrator`, `Member`, `Restricted`, `Left`, `Banned`/`Kicked`)

### Forum & Topics

Group owners can enable the **Forum** feature on their chat, which allows them to create **[topics](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups)** for specialized discussions.

Messages in topics are indicated with the `MessageThreadId` property. This property is equal to 1 for the **General** topic, or to the Message ID of the first message in topic.

Bots can [create/edit/close/reopen/delete](https://core.telegram.org/bots/api#createforumtopic) specific topics or the General topic.

**Important:** Bots can't fetch the current list of all topics in the chat.
However, your bot can keep track of active topics by listening to these service messages (with `MessageThreadId` set):
- `MessageType.ForumTopicCreated` and the `message.ForumTopicCreated` structure
- `MessageType.ForumTopicEdited` and the `message.ForumTopicEdited` structure
- `MessageType.ForumTopicClosed`
- `MessageType.ForumTopicReopened`
- ...
1 change: 0 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
- [Files & Documents](4/passport/files-docs.md)
- [Data Errors](4/passport/errors.md)
- [RSA Key](4/passport/key.md)
- [Decryption FAQ](4/passport/faq.md)
- [Frequently Asked Questions](FAQ.md)
- [Migration guides to newer versions](migrate/README.md)
- [Migrate to v22.*](migrate/Version-22.x.md)
Expand Down
6 changes: 6 additions & 0 deletions src/migrate/Version-22.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ _(if you use this [non-recommended](Version-21.x.md#request-structures) method)_
- `ToHtml`/`ToMarkdown`: support for ExpandableBlockquote (v22.1.1)
- fix savePreparedInlineMessage request (v22.1.2)
- `TransactionPartnerUser.Gift` type was corrected in Bot API (v22.1.3)

## What's new in version 22.2

- Support for [Bot API 8.1](https://core.telegram.org/bots/api-changelog#december-4-2024)
- Support for [Native AOT](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot) / [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/webassembly-build-tools-and-aot) / [Trimming](https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained)
_(this is still experimental and we would enjoy your feedback if you try to use the library in such contexts)_

0 comments on commit ed70afa

Please sign in to comment.