#discord #audio #channel #voice #bot #ci #chat #response #clips #discord-bot

bin+lib btfm

A Discord bot that plays audio clips based on voice chat

10 releases (4 breaking)

new 0.11.2 Apr 16, 2021
0.11.1 Apr 6, 2021
0.11.0 Mar 26, 2021
0.10.1 Feb 27, 2021
0.3.0 May 9, 2020
Download history 13/week @ 2021-01-05 2/week @ 2021-01-12 13/week @ 2021-01-19 15/week @ 2021-01-26 20/week @ 2021-02-02 20/week @ 2021-02-09 31/week @ 2021-02-16 18/week @ 2021-02-23 5/week @ 2021-03-02 8/week @ 2021-03-09 29/week @ 2021-03-23 7/week @ 2021-03-30 25/week @ 2021-04-06

66 downloads per month


1.5K SLoC


CI Security

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.


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 where the audio clips and database are stored. For example:

mkdir /var/lib/btfm/

Add clips and phrases with the btfm clip sub-commands:

btfm --btfm-data-dir /var/lib/btfm/ add "they found me" "I don't know how, but they found me..." run-for-it-marty.mp3

See btfm clip --help for available sub-commands and options.

Start the bot with btfm run. Parameters are accepted via CLI arguments or environment variables. For example, a systemd unit file to run the service under the "btfm" user (which should be able to read /var/lib/btfm/):

Description=BTFM Discord bot

ExecStart=/usr/local/bin/btfm run



See btfm run --help for command line arguments and documentation. To obtain the guild and channel ID, go to your Discord User Settings -> Appearance, and enable Developer Mode. You can then right-click on the server for and select "Copy ID" for the guild ID, and then right-click the voice channel you want the bot to watch and "Copy ID" that as well.

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.


~634K SLoC