Skip to content

Conversation

@i-vis
Copy link

@i-vis i-vis commented Sep 19, 2025

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use tox -e lint and even tox -e format to autofix what it can)
  • Test coverage added (use tox -e minimal)

Changes

I added a schema revolt://{server_api_url}/{bot_token}/{targets} to support self hosted instances of Revolt.Chat, instead of only supporting the official instance. The differentiation of revolt://{server_api_url}/{bot_token}/{targets} and revolt://{bot_token}/{targets} works by detecting if domain ends with /, i.e. %2F. I did this to preserve possibility to use the current scheme so as to avoid breaking changes.

All tests and ruff linting tests seem to pass. I haven't added new tests as I am inexperienced in that regard and anticipate a lot of changes to this PR if it is to be accepted.

Testing

Note: You need to be running a Revolt Chat server. If your api url contains forward slashes replace them with %2F:
revolt.domain.tld/api/ -> revolt.domain.tld%2Fapi%2F

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/i-vis/apprise.git@feature-revolt-selfhosted

# Test out the changes with the following commands:
# this corresponds to api link being {https://}revolt.domain.tld/api/
apprise -t "Test Title" -b "Test Message" \
  revolt://{revolt.domain.tld%2Fapi%2F}/{bot-token}/{channel-id}
  # this corresponds to official revolt chat server api
apprise -t "Test Title" -b "Test Message" \
  revolt://api.revolt.chat/{bot-token}/{channel-id}
# this corresponds to how plugin currently works (also official server api)
apprise -t "Test Title" -b "Test Message" \
  revolt://{bot-token}/{channel-id}

@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 47.36842% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.61%. Comparing base (27091b5) to head (12766e9).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
apprise/plugins/revolt.py 47.36% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1416      +/-   ##
==========================================
- Coverage   99.65%   99.61%   -0.05%     
==========================================
  Files         174      174              
  Lines       22554    22566      +12     
  Branches     3587     3590       +3     
==========================================
+ Hits        22476    22478       +2     
- Misses         70       78       +8     
- Partials        8       10       +2     
Files with missing lines Coverage Δ
apprise/plugins/revolt.py 93.00% <47.36%> (-7.00%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant