Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Telegram Thread/Topic handling #1177

Merged
merged 2 commits into from
Jul 28, 2024
Merged

Fix Telegram Thread/Topic handling #1177

merged 2 commits into from
Jul 28, 2024

Conversation

caronc
Copy link
Owner

@caronc caronc commented Jul 28, 2024

Description:

Related issue (if applicable): #1143

This turned out to be a documented feature that simply did not work until this PR. Provided Thread/Topic iD's on the Apprise URL were just ignored.

This PR fixes 2 key issues and adds ?thread= to the telegram support too.

  • You can provide threads by specifying ?topic=<id> or ?thread=<id> on the URL. This sets up a default thrad for all detected targets thereaftr (if defined at all).
  • You can also provide the topic/threads by adding them to each target (as originally documented) <target>:<topic> to just apply a topic to the specific target.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use flake8)
  • 100% test coverage

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@1143-discord-topic-defect

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message" \
  tgram://credentials?topic=valiue

Copy link

codecov bot commented Jul 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.26%. Comparing base (631ce10) to head (f96f22b).
Report is 10 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1177    +/-   ##
========================================
  Coverage   99.26%   99.26%            
========================================
  Files         142      144     +2     
  Lines       18428    18795   +367     
  Branches     3542     3611    +69     
========================================
+ Hits        18292    18657   +365     
- Misses        124      126     +2     
  Partials       12       12            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caronc caronc force-pushed the 1143-discord-topic-defect branch from 61ba910 to f96f22b Compare July 28, 2024 14:16
@caronc caronc linked an issue Jul 28, 2024 that may be closed by this pull request
@caronc caronc merged commit 4754052 into master Jul 28, 2024
14 checks passed
@schizovivek
Copy link

schizovivek commented Jul 29, 2024

I was confused why you were pointing me towards discord 😄 . . Am so glad you were able to find the issue and fix it !

Just tested it and it works perfectly ! Thank you ! I'll use this binary till your next release
image

For reference I used the below formats and both worked
'tgram://bot${bot_id}/${chat_id}/?topic=${message_thread_id}'
'tgram://bot${bot_id}/${chat_id}:${message_thread_id}'

@caronc caronc deleted the 1143-discord-topic-defect branch August 24, 2024 22:00
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.

Query: Telegram: Send message to topic
2 participants