Skip to content

Misterio77/disconic

Repository files navigation

Disconic

A bot to play your subsonic-compatible server's song on discord!

At the moment, one bot instance means one subsonic instance, and the bot only uses a single song queue, so there's no support for multi-server bots. Running this is pretty simple, though!

I use sunk to interact with subsonic, and serenity/poise to interact with discord.

Dependencies

You need rustc >= 1.70 to compile this crate. Use rustup to get it.

The only crate with non-rust dependencies is audiopus_sys, this means you need libopus installed to run this. If building, you'll also need pkg-config. Consult your distro's documentation on how to get these.

You can quickly get everything you need with nix:

nix develop

Building

To run from source, clone the repo and run:

# Build
cargo build --release && ./target/release/disconic --help
# Or build and run
cargo run --release -- --help

If you use nix:

# Build
nix build . && ./result/bin/disconic --help
# Or build and run
nix run . -- --help

# Or get a shell with disconic
nix shell .
disconic --help

With nix, you don't even need to clone the repo. Simply replace . with github:misterio77/disconic.

Usage

Start by creating a discord app and getting its bot token. Also get your guild (server) ID. These steps are already documented elsewhere, so will not be covered here.

You can configure the application through CLI arguments or environment variables. Use --help to see what the arguments and environment variables are.

Simply run the binary and everything will be setup for you. If your bot is not a member of the guild, disconic will error out and print the invitation URL. The bot will also automatically register its slash commands on your server whenever it starts.

Usage

You can use /song to search for individual songs, /album to search for entire albums, /random to queue a random song.

You may use /pause, /resume, and /stop to control playback.

Your queue can be viewed with /queue, songs can be removed with /remove and/or /skip.

The bot should run your voice channel automatically when you do any command related to it. You can run /join to call it explicitly, and /leave to make it go away.

Contributing

Patches are welcome! See the "building" section on how to hack on the package.

I will not try to document the project structure, as this will just get outdated. Just get rust-analyzer and jump around the project, it should be pretty self-explanatory.

TODO

  • Dialog to choose among multiple matches
  • Implement volume
  • Show album arts
  • Playlist support
  • Seeking
  • Multi-guild support?

About

Discord bot for interacting with subsonic music libraries

Resources

License

Stars

Watchers

Forks

Packages

No packages published