piper-bot

Crates.iopiper-bot
lib.rspiper-bot
version3.0.0
sourcesrc
created_at2023-04-01 05:12:39.758904
updated_at2024-09-30 06:57:18.343528
descriptionA bot that reads messages from a named pipe and sends them to Discord.
homepage
repositoryhttps://codeberg.org/NoraPerry/piper-bot
max_upload_size
id827086
size74,628
Nora Perry (NoraPerry)

documentation

README

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.
Commit count: 0

cargo fmt