# Piper Bot Piper Bot is a Discord bot which reads messages in from a named pipe on the host file system, then sends them to a specified Discord channel. # Installation/Usage - Install `piper-bot` by running `cargo install --path .` in the project directory. - Create a named pipe by running `mkfifo path/to/pipe`. - Acquire a Discord bot token and channel id. - The channel id may be for a guild channel or DM. - To find the id of a guild channel, enable developer mode in Discord settings, then right click the channel and click "Copy ID". - To find the id of a DM channel, open Discord in a browser and start a DM with the bot account, then copy the number from the last part of the url. - Copy the example config file to your user config directory (`cp config.kdl.example ~/.config/piper-bot/config.kdl`), and replace the example values. - Start the bot by running `piper-bot`. - You can now write a message to the pipe (for example `echo hello > path/to/pipe`) and the bot will send the message to Discord. # Running In Docker - Create a `mnt` folder in the project directory. This will be mounted into the container so it can access the config and pipe files. - Create the named pipe inside the `mnt` folder (e.g. `mnt/pipe`). - Copy the `config.kdl.example` file to `mnt/config.kdl` and replace the example values. The `mnt` folder is mounted to `/mnt`, so if your pipe is at `mnt/pipe` then in the config file you should put `fifo "/mnt/pipe"`. - Start the bot by running `docker compose up --build -d`.