a Discord bot that tracks new pull requests of the ppy/osu-wiki repository. it's a GitHub web hook, except not really:
- it's not a GitHub web hook, it's a service you have to host
- it can be repurposed for another repository you don't own (as well as
ppy/osu-wiki
) - it's stateful (has its own local database to work around API slowness)
- it has latency (up to 2 minutes in a worst case scenario)
- you can talk to it using miscellaneous commands. sometimes it replies
- notify reviewers in Discord about new relevant pull requests
- pin a pull request in Discord and keep track of it until it's closed
- merge statistics over a time period
.help
for general overview.help commandname
for details oncommandname
I'm considering providing it as a service, but there's a long way to go. for now, set it up yourself.
- create a Discord application and add a bot account to it.
- add the bot to your server using a modified version of an OAuth2 authorization link from Bot Authorization Flow.
- clone the repository. create a modified version of
config/config.example.yaml
anf fill in whatever data you need - to benefit from GitHub's extended API limits, query it using an API token (get one at Personal access tokens)
to update to the last stable version, stop the bot and execute:
git fetch && git checkout main
git pull origin main
git checkout $( git tag --list --sort=v:refname | tail -n 1 )
use bin.sh
from the source directory:
./bin.sh setup # install all dependencies
./bin.sh run --config /path/to/config.yaml # takeoff in 5, 4, 3...
./bin.sh clean # remove virtual environment and Python bytecode cache
./bin.sh test # run unit tests with pytest
./bin.sh test -x -k TestDiscordCommands # stop on first failure of a subset
./bin.sh coverage # generate coverage data
./bin.sh cov # print coverage stats in terminal
./bin.sh hcov # render and open a nice HTML with coverage stats
if anything goes wrong, make extensive use of a runtime log located at {runtime}/librarian.log
see requirements.txt
for a list of cool packages