Skip to content

Telegram bot powered by OpenAI API

License

Notifications You must be signed in to change notification settings

edgard/murailobot

Repository files navigation

MurailoBot 🤖

Go Report Card License: CC0-1.0 Go Version GitHub Release

A Telegram bot powered by AI models that provides intelligent responses through the Telegram messaging platform.

Features

  • Chat with AI through Telegram
  • Persistent conversation history
  • Role-based access control
  • Docker support
  • Simple YAML configuration

Prerequisites

  • Go 1.24+
  • Telegram Bot Token (from @BotFather)
  • AI API Key (compatible with OpenAI API format)

Quick Start

  1. Get the bot:
git clone https://github.com/edgard/murailobot.git
cd murailobot
  1. Configure:
cp config.yaml.example config.yaml
# Edit config.yaml with your tokens and admin ID
  1. Run:
make build
./murailobot

Docker

docker pull ghcr.io/edgard/murailobot:latest
docker run -v $(pwd)/config.yaml:/app/config.yaml ghcr.io/edgard/murailobot:latest

Configuration

Required Settings

Minimal config.yaml example:

ai:
  token: "sk-your-token-here"            # AI API token
  base_url: "https://api.openai.com/v1"  # API endpoint URL

telegram:
  token: "your-telegram-bot-token"    # Telegram bot token
  admin_id: 123456789                 # Admin's Telegram ID

For a complete configuration with all options, see config.yaml.example.

Environment Variables

Configuration can also be provided through environment variables:

export BOT_AI_TOKEN="your-ai-token"
export BOT_AI_BASE_URL="https://api.openai.com/v1"
export BOT_TELEGRAM_TOKEN="your-telegram-token"
export BOT_TELEGRAM_ADMIN_ID="123456789"

Environment variables follow the pattern BOT_SECTION_KEY where section and key correspond to the YAML structure.

Commands

  • /start - Initialize bot conversation
  • /mrl <message> - Generate AI response
  • /mrl_reset - Clear chat history (admin only)

Release Process

This project uses an automated release workflow. Here's how it works:

Automated Releases

When code is pushed to the main branch, the following happens automatically:

  1. The CI workflow detects changes in the codebase
  2. Version is automatically bumped based on commit messages:
    • fix: or fix(scope): → patch bump
    • feat: or feat(scope): → minor bump
    • BREAKING CHANGE: in commit body → major bump
  3. A new git tag is created with the new version
  4. A GitHub release is generated with release notes
  5. Binary artifacts are built for multiple platforms
  6. Docker images are built and pushed to GitHub Container Registry

For Contributors

  • No need to manually create version tags or releases
  • Use Conventional Commits format for your commit messages
  • The release type (patch, minor, major) is determined by your commit messages

All releases are available on the Releases page.

License

CC0 1.0 Universal - see LICENSE file

Links