Skip to content

fix: detecting group creation message - #40

Merged
missytake merged 6 commits into
mainfrom
fix-original-msg-detection
Jul 20, 2026
Merged

missytake merged 6 commits into
mainfrom
fix-original-msg-detection

Conversation

@missytake

@missytake missytake commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Depending on the core and team-bot version when the chat was created, the group creation message can be in a different position and have different wording. Iterating through legacy wordings as well, through the first three messages, should be enough to catch it.

The current behavior leads to failing messages with the following traceback:

Traceback (most recent call last):                                                                   
  File "/home/das_synthikat/.local/lib/team-bot.venv/lib/python3.11/site-packages/deltachat_rpc_client/client.py", line 136, in _on_event                                  
    hook(event)                                                                       
  File "/home/das_synthikat/.local/lib/team-bot.venv/lib/python3.11/site-packages/team_bot/relay.py", line 98, in incoming_message                                         
    handle_msg_in_relay_group(msg)                                                                   
  File "/home/das_synthikat/.local/lib/team-bot.venv/lib/python3.11/site-packages/team_bot/relay.py", line 176, in handle_msg_in_relay_group                               
    forward_to_outside(msg)                                                                   
  File "/home/das_synthikat/.local/lib/team-bot.venv/lib/python3.11/site-packages/team_bot/forwarding.py", line 55, in forward_to_outside                                  
    raise e                                                                   
  File "/home/das_synthikat/.local/lib/team-bot.venv/lib/python3.11/site-packages/team_bot/forwarding.py", line 38, in forward_to_outside                                  
    if msg.quote.message_id == get_group_creation_msg(msg.chat).id:                                                                                                        
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                        
  File "/home/das_synthikat/.local/lib/team-bot.venv/lib/python3.11/site-packages/team_bot/util.py", line 71, in get_group_creation_msg                                    
    assert msgs[1].get_snapshot().text[:20] in ["This is a chat with ", "We sent a message to"]                                                                       
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError                                                                                                                                                             

Comment thread src/team_bot/util.py Outdated
Comment thread src/team_bot/util.py Outdated
Comment thread src/team_bot/util.py Outdated
Comment thread src/team_bot/util.py Outdated
@missytake
missytake force-pushed the fix-original-msg-detection branch from 7586cb4 to b59ec0e Compare July 20, 2026 10:14
@missytake
missytake merged commit 0aa7fc1 into main Jul 20, 2026
2 checks passed
@missytake
missytake deleted the fix-original-msg-detection branch July 20, 2026 10:58
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.

3 participants