A feature-rich discord bot with functionality all around osu!
- check recent plays (
<r//rs) - track top scores (
<track,<trackmania, ... //track) - a background guessing game (
/bg) - display the personal top scores with various filters and orderings (
<top//top) - show your best scores on a map (
<c//cs) - compare top scores among players (
<common//compare top) - check a map's global leaderboards (
<lb//leaderboard) - calculate a performance rating for players of a multiplayer match (
<mc//matchcost) - live track an ongoing multiplayer match (
/matchlive) - simulate scores with arbitrary acc, combo, amount 300s, ... (
/simulate) - display a bunch of statistics all around a users osu profile (
<osu,<taiko, ... //profile) - recalculate the personal top 100 if all scores were unchoked (
<nc//nochoke) - show all scores of a user that are in the top of a map's global leaderboard (
<osg//osustats scores) - list server members in order of some attribute in their osu! profile like pp, medal count, ... (
/serverleaderboard) - notify a channel when a twitch streams comes online (
/trackstream/<addstream) - configure various user or server settings (
/config,/serverconfig) - ... and a ton more
All osu! gamemodes are supported and commands exist as slash commands as well as prefix commands.
With the <help command the bot will DM you a list of all available prefix commands. With <help [command name] (e.g. <help osg) the bot will explain the command, show how to use it and give examples.
For help on slash commands, use the /help command.
To invite the bot to your server, use this link.
You can also join its discord server to keep up with updates, suggest features or report bugs.
- Tanza for the main icon and slick webpages
- 5joshi for these CRAZY GOOD button emotes :)
- Mr Helix and his website huismetbenen for providing snipe data (honorable mention molneya)
- Piotrekol and Ezoda and their website osustats for providing leaderboard data
- mulraf, Tanza, and the rest of the osekai team for providing medal data
- OMKelderman and his flag conversion service
- respektive for his score rank api, osustats api, and various other contributions
- MasterIO and Wieku for providing the option to render scores via ordr
- Ameo for providing various historical data via osutrack
- StanR and his relaxation vault
- All the contributors to Bathbot ♥
- Difficulty & performance calculation: rosu-pp
- osu!api: rosu-v2
- Discord: twilight
- Database: sqlx (postgres)
- Redis: bb8-redis
- Server: axum
I wouldn't necessarily recommend to try and get the bot running yourself but feel free to give it a shot.
Rust must be installed and additionally either docker must be installed to setup the databases automatically (recommended) or postgres and redis must be installed manually.
- Copy the content of
.env.exampleinto a new file.envand provide all of its variables. The most important ones areDISCORD_TOKENOSU_CLIENT_IDOSU_CLIENT_SECRET
- If you don't run through docker, be sure these env variables are also set
DATABASE_URLREDIS_HOSTREDIS_PORT
- If you do run through docker, you can
- boot up the databases with
docker-compose up -d(must be done) - use
docker psto make surebathbot-dbandbathbot-redishave the statusUp - to inspect the postgres container, use
docker exec -it bathbot-db psql -U bathbot -d bathbot - to inspect the redis container, use
docker exec -it bathbot-redis redis-cli - to shut the databases down, use
docker-compose down
- boot up the databases with
- Next, install
sqlx-cliif you haven't already. You can do so withcargo install sqlx-cli --no-default-features --features postgres,rustls. - Then
cd bathbot-psqland migrate the database withsqlx migrate run. This command will complain if theDATABASE_URLvariable in.envis not correct. - And finally you can
cd ..again to compile and run the bot withcargo run. To make the bot run faster but compiling take longer, usecargo run --release.
The bot also has various features that can be enabled in compilation:
global_slash: Instead of only registering slash commands in the server specified asDEV_GUILD_IDin the.env, register them globally so that they work in all servers and DMs.matchlive: Enables the matchlive commands and a background loop that regularly checks all tracked matches for updates.twitchtracking: Enables the stream tracking commands and a background loop that regularly checks all tracked streams for activity.server: Runs a server onlocalhost:{SERVER_PORT}(specified in.env) and enables the link command. In order for linking and its authentication to succeed, you must configure the redirect URL in your osu! (and twitch) settings and setPUBLIC_URLin the.envaccordingly. E.g for osu! you go to your profile settings, check the oauth section for your own clients, edit the Application Callback URL tohttp://localhost:27272/auth/osuand in your.envmake sure you haveSERVER_PORT=27272andPUBLIC_URL="http://localhost:27272". The server also exposes a/metricsendpoint providing prometheus data. If you're interested in visualizing them, you need to install prometheus, configure it, install and configure grafana, then create a dashboard in grafana for the bathbot metrics.full: Enables all of the above
To enable these features, use e.g. cargo run --features global_slash,server