btfm 0.3.0

A Discord bot that plays audio clips based on voice chat
docs.rs failed to build btfm-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: btfm-0.19.0

btfm

I don't know how, But They Found Me (BTFM).

btfm is a Discord bot that listens on a voice channel for key phrases, and plays audio clips into the channel in response.

Setup

Download the deepspeech native_client build for your platform, along with the acoustic model.

Set up your paths so that deepspeech can be found by the compiler (or drop it into /usr/local/lib/ and run ldconfig).

Install make, autotools, libopus headers, libsqlite headers, libsodium headers, and the openssl headers.

Create the data directory and database:

export BTFM_DATA_DIR=/some/dir
export DATABASE_URL=$BTFM_DATA_DIR/btfm.sqlite3
cargo install diesel_cli
diesel setup

To run, the following environment variables are required:

  • BTFM_DATA_DIR: Path to the data directory where btfm should store clips and where the database is. A special "hello" audio file must be in the root of this directory and is played on joins to the channel
  • DEEPSPEECH_MODEL: Path to the deepspeech model.
  • DISCORD_TOKEN: Your Discord API token.
  • CHANNEL_ID: The Discord Channel ID to join when someone else joins.
  • GUILD_ID: The Discord Guild ID being connected to.

Development environment

If you are so inclined, there is a Dockerfile and some helper scripts in the devel/ folder that you may find to be handy for development. The scripts assume you have podman installed. You can use build.sh to build a development container, and you can use cargo.sh to run Rust's cargo tool inside the container. You can probably guess what test.sh does, if you are somebody's kid and are smart.