Skip to content

rezacute/carik-bot

Repository files navigation

carik-bot logo

carik-bot

carik (Javanese: ꦕꦫꦶꦏ) — A faithful Javanese butler for your digital life.

carik (pronounced "cha-reek") is a Telegram bot with AI capabilities, named after the Javanese word for a trusted household servant.


Features

  • 🤖 Telegram Integration — Long polling Bot API support
  • 🧠 LLM Integration — Groq-powered AI responses with conversation memory
  • 📰 RSS News — Fetch and summarize news from 40+ country feeds
  • 🎯 Command System — Prefix-based commands with help auto-generation
  • 🔐 RBAC — Owner/Admin/User/Guest roles with SQLite database
  • 📊 Rate Limiting — 1 query/minute, 20 queries/hour per user
  • 🔌 Docker Support — Kiro CLI runs in Docker container for isolation
  • 🏗️ Clean Architecture — Domain, Application, Infrastructure layers
  • 🖥️ Desktop GUI — Optional Tauri desktop app with system tray
  • ⚙️ Config Management — YAML + environment variables
  • 🔌 Plugin System — MCP/A2A/Wasm plugin architecture (in progress)
  • 🔌 Plugin System — MCP/A2A/Wasm plugin architecture (in progress)

Commands

Command Description Access
/start Show Javanese greeting All
/help Show help message All
/ping Pong! All
/about About carik-bot All
/clear Clear conversation history All
/quote Get a random quote All
/connect Request guest access Guest
/approve <id> Approve guest (owner) Owner
/users Manage users Owner/Admin
/workspace Manage workspaces All
/rss [source] Fetch RSS news Approved
/settings Your personal settings All
/scramble Start a word scramble game All
/hint Get a hint in the game All
/guess [word] Guess the answer All
/quit Quit the current game All

Translate

The bot can translate messages using AI:

  • Reply to a message + type "translate to [language]"
  • Example: Reply to any message with "translate to javanese"
  • Supported languages: English, Indonesian, Javanese, Spanish, Chinese, Japanese, Korean
  • Also works: "terjemahkan ke indonesia", "apa artinya hello"

Mini-Apps

Scramble Game — Unscramble the letters to find the word!

  • /scramble — Start a new game
  • /hint — Get a hint (max 2 per game)
  • /guess [word] — Submit your guess
  • /quit — Quit the current game

Example:

/scramble
🎮 *Scramble Game!*
Unscramble this word:
*`TSUR`*

/hint
💡 Hint: Programming language

/guess RUST
🎉 Correct! The answer was RUST!

RSS News Sources

Just say "news about [country]" and the bot will fetch and summarize!

Country Keywords
Argentina argentina
Australia australia
Brazil brazil
Canada canada
China china
France france
Germany germany
India india
Indonesia indonesia
Italy italy
Japan japan
Mexico mexico
Russia russia
Saudi Arabia saudi
South Africa south africa
South Korea korea
Turkey turkey
UK uk, britain
USA usa, america
EU eu, europe

Plus: Singapore, Malaysia, Vietnam, Thailand, Philippines, Myanmar, Cambodia, Pakistan, Bangladesh, Sri Lanka, Nepal, Kazakhstan, Uzbekistan, Taiwan, Israel, UAE, Qatar, Iran, Mongolia, North Korea

Topics: technology, business, sports, entertainment

Kiro Commands (AI Agent in Docker)

Installation Guide

Quick Start (Linux)

# 1. Install prerequisites
sudo apt update
sudo apt install rustc cargo docker.io

# 2. Clone the repository
git clone https://github.com/rezacute/carik-bot.git
cd carik-bot

# 3. Configure
cp config.yaml.example config.yaml
# Edit config.yaml with your settings

# 4. Set environment variables
export BOT_TOKEN="your_telegram_bot_token"
export BOT_OWNER_ID="your_telegram_user_id"
export GROQ_API_KEY="your_groq_api_key"

# 5. Run
cargo build --release
./target/release/carik-bot run

Prerequisites

Build & Run

# Clone and build
git clone https://github.com/rezacute/carik-bot.git
cd carik-bot
cargo build --release

# Configure
cp config.yaml.example config.yaml
# Edit .env with your BOT_TOKEN and GROQ_API_KEY

# Run with Telegram
./target/release/carik-bot run

Cross-Platform Installation

Linux

cd installers
chmod +x linux.sh
sudo ./linux.sh

macOS

cd installers
chmod +x mac.sh
./mac.sh

Windows

cd installers
.\windows.ps1

systemd Deployment (Linux)

# Install as systemd service
sudo cp carik-bot.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable carik-bot
sudo systemctl start carik-bot

# Check status
systemctl status carik-bot

# View logs
journalctl -u carik-bot -f

Desktop GUI

Optional desktop GUI with system tray:

cd gui
npm install
npm run tauri build

The GUI provides:

  • System tray icon
  • Start/Stop bot controls
  • View logs
  • Quick settings

Configuration

config.yaml

bot:
  name: carik-bot
  prefix: "!"

whitelist:
  enabled: true
  users:
    - "6504720757"

guests:
  enabled: true
  pending: []
  approved: []

Environment Variables

BOT_TOKEN=your_telegram_bot_token_here
GROQ_API_KEY=your_groq_api_key_here
BOT_OWNER_ID=your_telegram_user_id  # Owner user ID (required)

User Management

Roles

  • owner - Full access, can manage users (set via BOT_OWNER_ID env var)
  • admin - Can manage users, all commands
  • user - Regular access
  • guest - Limited, needs approval

Owner Setup

Set the owner via environment variable:

# In systemd
sudo systemctl set-environment BOT_OWNER_ID=6504720757
sudo systemctl restart carik-bot

Or add to /etc/environment:

BOT_OWNER_ID=6504720757

The owner cannot be modified by other users - it's protected.

User Commands

Command Description
/users list List all users
/users add <id> <role> Add user (admin, user, guest)
/users remove <id> Remove user
/users info <id> Get user info
/users setrole <id> <role> Change user role

Personalization

Each user can customize their experience:

Command Description
/settings View your settings
/settings set language <en|id|jv> Set language (English, Indonesian, Javanese)
/settings set timezone <TZ> Set timezone
/settings set prompt <text> Custom system prompt for LLM

Example:

/settings set language jv
/settings set prompt You are a helpful coding assistant

Flow

  1. Guest sends /connect → request goes to pending
  2. Owner runs /approve <user_id> → user approved
  3. Owner runs /users add <id> user → user added with role

Rate Limiting

  • 1 query per minute per user
  • 20 queries per hour per user
  • Owner is exempt from rate limiting

Architecture

src/
├── domain/              # Core business logic
│   ├── entities/       # Message, Command, User
│   └── traits/         # Bot trait
├── application/        # Use cases
│   ├── errors.rs       # Domain errors
│   └── services/       # CommandService
├── infrastructure/     # External concerns
│   ├── config/        # YAML config
│   ├── database/      # SQLite (users, rate limits)
│   ├── adapters/       # Telegram, Console
│   └── llm/           # Groq LLM provider
└── main.rs             # CLI entry point

Docker

Kiro CLI runs in a Docker container for isolation:

# Container is auto-created
docker ps | grep kiro-persistent

Tech Stack

Component Technology
Language Rust 1.70+
Async Tokio
Telegram reqwest + serde
LLM Groq API
Database SQLite (rusqlite)
Config serde_yaml
Logging tracing + journald
CLI clap

License

MIT

About

AI-powered Telegram bot with Groq LLM, RSS news, Kiro coding agent, user management, and personalization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors