Skip to content
m1sk9Public

About

A lightweight, fast citation message Discord bot.

Topics

Resources

Security policy

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

babyrite

CI Release babyrite Apache License 2.0 codecov

babyrite is a lightweight, fast citation message Discord bot.

# Latest Release
docker pull ghcr.io/m1sk9/babyrite:latest

# Minor Release
docker pull ghcr.io/m1sk9/babyrite:v2

# Specific Release
docker pull ghcr.io/m1sk9/babyrite:v2.0.0

API Support: requires Discord API v10

babyrite API Documentation

Features

  • Message Previews: babyrite parses Discord message links and displays messages as embedded content.
  • GitHub Permalink Expansion: babyrite can expand GitHub permalinks and display the content of the linked file.
  • Lightweight: babyrite uses distroless as its base image and consists of a very lightweight Docker Image.
  • Fast: babyrite is developed in Rust and is very fast!
  • OSS: babyrite is open-source and licensed under the Apache License 2.0. It also provides a way to host it yourself as well as publish it as OSS.
  • Easy to Use: babyrite is very easy to use and can be deployed in seconds.

Message Previews

Detects Discord message links (https://discord.com/channels/...) and expands them as embedded content.

  • Supports Production, PTB, and Canary client URLs
  • Expands up to 3 links per message
  • Validates NSFW channels, permissions, and privacy

GitHub Permalink Expansion

Detects GitHub permalinks (blob URLs containing a commit SHA) and expands file content as code blocks.

  • Supports line range specifications (#L10-L20)
  • Expands up to 3 links per message
  • Display truncated to 50 lines by default (configurable); only the displayed lines are downloaded, up to a 1MB read limit

Installation

You can install babyrite using Docker. The following command will pull the latest version of babyrite.

docker pull ghcr.io/m1sk9/babyrite:v1

Using Docker Compose

It is recommended to use Docker Compose when setting up babyrite. Direct startup using Docker images or binary files is also possible but not recommended.

services:
  app:
    image: ghcr.io/m1sk9/babyrite:v1
    env_file:
      - .env
    restart: always

If you are using orchestration tools such as k8s or Docker Swarm, please configure them according to their respective configuration files.

Configuration

You can customize the behavior of babyrite by using a dedicated configuration file. The settings are written in TOML format. Refer to config/config.toml for configuration items.

You can also start with the default settings without configuring. The following are the default settings used in that case.

[log]
level = "babyrite=info"
format = "compact"

[features]
github_permalink = true

[github]
max_lines = 50
Key Description Default Value
log.level Log level filter (same syntax as RUST_LOG). Overridden by RUST_LOG if set. "babyrite=info"
log.format Log output format: "compact" or "json". "compact"
json_logging Deprecated. Use log.format = "json". Only used when log.format is unset. false
features.github_permalink Enable or disable GitHub Permalink expansion. true
github.max_lines Maximum number of lines to display without truncation. 50

Logging

babyrite uses tracing and emits logs to standard output.

  • Log level is resolved in this order: the RUST_LOG environment variable (if set) takes precedence, otherwise the log.level setting in config.toml is used (default babyrite=info). For development, set RUST_LOG=babyrite=debug or log.level = "babyrite=debug" to surface detailed debug logs (cache hit/miss, external API timings, permission-check decisions).
  • Structured output for Grafana Loki and similar. Set log.format = "json" to emit one JSON object per line. Each line carries structured fields — including message_id, guild_id, and channel_id from the per-request span — so a single request can be correlated end-to-end. Scrape the container's stdout with Promtail or Grafana Alloy and query the fields in LogQL with the | json parser.

Environment Variables

The environment variables used by babyrite are as follows. Note that the only environment variable required for startup is DISCORD_API_TOKEN.

Key Description
DISCORD_API_TOKEN Discord API token
CONFIG_FILE Path to the configuration file (recursive path)
RUST_LOG Log level filter. Overrides log.level in the configuration file when set.

LICENSE

babyrite is published under Apache License 2.0.

® 2023 - 2026 m1sk9
babyrite is not affiliated with Discord.

About

A lightweight, fast citation message Discord bot.

Topics

Resources

Security policy

Stars

5 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages