# Butter Robot ![Status badge](https://woodpecker.local.fmartingr.dev/api/badges/5/status.svg) Go framework to create bots for several platforms. ![Butter Robot](./assets/icon@120.png) > What is my purpose? ## Features - Support for chat platforms (Telegram) - Plugin system for easy extension - Admin interface for managing channels and plugins - Message queue for asynchronous processing - Optional Sentry error reporting and tracing ## Documentation [Go to documentation](./docs) ### Database Management ButterRobot includes an automatic database migration system. Migrations are applied automatically when the application starts, ensuring your database schema is always up to date. [Learn more about migrations](./docs/migrations.md) ## Installation ### From Source ```bash # Clone the repository git clone https://git.nakama.town/fmartingr/butterrobot.git cd butterrobot # Build the application go build -o butterrobot ./cmd/butterrobot ``` ### Containers The `fmartingr/butterrobot/butterrobot` container image is published on Github packages: ```bash docker pull docker.pkg.git.nakama.town/fmartingr/butterrobot/butterrobot:latest docker run -d --name butterrobot -p 8080:8080 docker.pkg.git.nakama.town/fmartingr/butterrobot/butterrobot:latest ``` ## Configuration Configuration is done through environment variables: - `DEBUG`: Set to "y" to enable debug mode - `BUTTERROBOT_HOSTNAME`: Hostname for webhook URLs - `LOG_LEVEL`: Logging level (DEBUG, INFO, WARN, ERROR) - `SECRET_KEY`: Secret key for sessions and password hashing - `DATABASE_PATH`: Path to SQLite database file ### Observability Sentry error reporting is optional and off until a DSN is provided: - `SENTRY_DSN`: Sentry DSN (empty disables reporting) - `SENTRY_ENVIRONMENT`: Environment name (default `production`) - `SENTRY_RELEASE`: Release identifier (defaults to the build version) - `SENTRY_TRACES_SAMPLE_RATE`: Fraction of HTTP requests traced, `0.0`-`1.0` (default `0`) - `SENTRY_ENABLE_LOGS`: Set to `y` to forward non-error logs to Sentry [Learn more about observability](./docs/observability.md) ### Platform-specific configuration #### Telegram - `TELEGRAM_TOKEN`: Telegram bot token ## Contributing ```bash git clone git@github.com:fmartingr/butterrobot.git cd butterrobot go mod download ``` Create a `.env-local` file with the required environment variables: ``` TELEGRAM_TOKEN=xxx ... ``` And then you can run it directly: ```bash go run ./cmd/butterrobot/main.go ``` ## License GPL-2.0