MCPcopy Index your code
hub / github.com/Lifailon/openrouter-bot

github.com/Lifailon/openrouter-bot @0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.5.0 ↗ · + Follow
50 symbols 121 edges 10 files 11 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

OpenRouter Bot

English (🇺🇸) | Русский (🇷🇺)

This project allows you to launch your Telegram bot in a few minutes to communicate with free and paid AI models via OpenRouter, or local LLMs, for example, via LM Studio.

[!NOTE] This repository is a fork of the openrouter-gpt-telegram-bot project, which adds new features (such as switch current model and Markdown formatting in bot responses) and optimizes the container startup process.

Example

<img src="https://github.com/Lifailon/openrouter-bot/raw/0.5.0/img/example.png">
<img src="https://github.com/Lifailon/openrouter-bot/raw/0.5.0/img/commands.png">

Preparation

[!TIP] When you launch the bot, you will be able to see the IDs of other users in the log, to whom you can also grant access to the bot in the future.

Installation

To run locally on Windows or Linux system, download the pre-built binary (without dependencies) from the releases page.

Running in Docker

  • Create a working directory:
mkdir openrouter-bot
cd openrouter-bot
  • Create .env file and fill in the basic parameters:
# OpenRouter api key
API_KEY=
# Free modeles: https://openrouter.ai/models?max_price=0
MODEL=deepseek/deepseek-r1:free
# Telegram api key
TELEGRAM_BOT_TOKEN=
# Your Telegram id
ADMIN_IDS=
# List of users to access the bot, separated by commas
ALLOWED_USER_IDS=
# Disable guest access (enabled by default)
GUEST_BUDGET=0
# Language used for bot responses (supported: EN/RU)
LANG=EN

The list of all available parameters is listed in the .env.example file

  • Run a container using the image from Docker Hub:
docker run -d --name OpenRouter-Bot \
    -v ./.env:/openrouter-bot/.env \
    --restart unless-stopped \
    lifailon/openrouter-bot:latest

The image is build for amd64 and arm64 (Raspberry Pi) platforms using docker buildx.

Build

git clone https://github.com/Lifailon/openrouter-bot
cd openrouter-bot
docker-compose up -d --build

Core symbols most depended-on inside this repo

Translate
called by 27
lang/lang.go
GetCurrentCost
called by 6
user/usage_tracker.go
saveUsage
called by 3
user/usage_tracker.go
GetConfig
called by 3
config/config_manager.go
LoadTranslations
called by 2
lang/lang.go
AddMessage
called by 2
user/history.go
GetMessages
called by 2
user/history.go
CheckHistory
called by 2
user/history.go

Shape

Function 17
Method 17
Struct 16

Languages

Go100%

Modules by API surface

user/usage_tracker.go13 symbols
user/types.go8 symbols
config/config.go6 symbols
config/config_manager.go5 symbols
api/openrouter.go5 symbols
user/history.go4 symbols
user/users_manager.go3 symbols
config/param.go3 symbols
lang/lang.go2 symbols
main.go1 symbols

For agents

$ claude mcp add openrouter-bot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact