Skip to content

Conversation

@jiz4oh
Copy link
Member

@jiz4oh jiz4oh commented Apr 17, 2025

close #137, 用法详情可参考 https://jiz4oh.com/2025/04/set-topic-in-efb

jiz4oh and others added 30 commits April 12, 2025 16:21
Adds support for Telegram topics by:
- Adding topic association database model to track topic linkages
- Implementing thread_id handling in message processing
- Adding topic group configuration option
- Enhancing message editing and reply handling for topics
- Improving error handling and logging for topic operations

This change allows mapping slave chats to Telegram topics within a designated
forum group, enabling better organization of multi-chat conversations.
- Add null check when looking up topic associations to prevent errors
- Fix thread_id initialization order in master message processing
- Fix topic creation to use proper author name field
Add message_thread_id parameter to all send_chat_action calls to properly
show typing indicators and upload status in topic threads. Modify
bot_manager to handle thread_id parameter by converting it to the proper
api_kwargs format.
When replying in topic threads, only quote the message if it's not the
topic starter message (where message_id equals message_thread_id). This
prevents unnecessary quoting of topic headers in thread conversations.
Change message_thread_id check in send_chat_action to explicitly compare
with None instead of truthy check, fixing cases where thread ID could be
0 or other falsy values.
- Add reopen_forum_topic method to handle closed topics
- Fix topic association lookup to use latest thread ID
- Add topic association cleanup before creating new topics
- Handle BadRequest errors in topic operations
- Fix message_thread_id handling in chat actions
Remove topic association from database when linking chats to prevent
orphaned topic entries. Add error handling around the cleanup to ensure
linking process continues even if topic removal fails.
Add additional validation for topic messages and proper debug logging
when messages are ignored. This helps troubleshoot issues with topics
that aren't created by the bot or messages from invalid topic groups.
Updates the forum topic creation to use chat.chat_title instead of chat.name
Prevents the channel from attempting to process topic groups for system chats,
which could lead to unexpected behavior since system chats are not meant to
be linked to topics.
…essor

reopen_forum_topic have strict rate limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Support Topics

2 participants