Skip to main content

BotLane

Run a Grok-powered bot from Telegram.

PyPI version npm version License: MIT

Open-source bridge that connects a Grok (xAI) bot to Telegram and lets you drive it straight from chat — one-to-one, in groups, or with scheduled tasks. No server to babysit, no webhooks to configure.

Why it exists

People who run agent bots on X want to reach them from Telegram too — the same bot, the same memory, no extra setup. BotLane is that bridge:

  • Dependency-free — the Python SDK and local bridge use only the standard library. No pip installs beyond talocode-botlane.
  • 1:1 and group mode — private chats work out of the box; in groups the bot responds only to @mention, /commands, and replies.
  • Session memory — per-chat conversation history persisted to disk.
  • Secure by default — an allowlist gates who can talk to the bot so your credits don't get drained by strangers.
  • Hosted path available — use the open tool locally, or run it on Talocode Cloud under /v1/botlane/* for managed power.

Part of Talocode: open tools people trust, hosted power behind them.

Install

pip install talocode-botlane

Node version (CLI, SDK, MCP server, HTTP API):

npm install -g @talocode/botlane

Quickstart

Talk to a hosted BotLane instance

from botlane import BotLaneClient

client = BotLaneClient()          # uses TALOCODE_API_KEY + TALOCODE_BASE_URL
print(client.health())
client.send(chat_id=123456789, text="Hello from the bot")
reply = client.chat("Summarize the last 3 messages")
print(reply)

Run a local bridge from Python

from botlane import BotLaneBridge

bridge = BotLaneBridge()          # uses TELEGRAM_BOT_TOKEN + XAI_API_KEY
bridge.run()                      # long-polls Telegram and replies with Grok

Auth / env

The Python SDK reads the same environment the hosted path uses:

Env var Default Purpose
TALOCODE_API_KEY API key for hosted/self-hosted BotLane API.
TALOCODE_BASE_URL https://api.talocode.site Hosted API base URL.
TELEGRAM_BOT_TOKEN Required for the local bridge. Bot token from @BotFather.
XAI_API_KEY Required for the local bridge. xAI (Grok) key.
BOTLANE_MODEL grok-3-mini Model used for completions.

API surface

Hosted routes (Talocode Cloud)

Method Path Description
GET /v1/botlane/health Liveness + config summary.
POST /v1/botlane/chat One-off Grok completion.
POST /v1/botlane/send Send a message from the bot.
GET /v1/botlane/history Per-chat conversation history.
POST /v1/botlane/reset Clear a chat's history.

Auth:

Authorization: Bearer $TALOCODE_API_KEY
# or
X-Api-Key: $TALOCODE_API_KEY

SDK methods

Method Description
BotLaneClient.health() Check instance health.
BotLaneClient.chat(prompt, ...) One-off Grok completion.
BotLaneClient.send(chat_id, text) Send a message from the bot.
BotLaneClient.history(chat_id) Read per-chat history.
BotLaneClient.reset(chat_id) Clear a chat's history.
BotLaneBridge.run() Start the local long-polling bridge.

CLI

botlane check                          # validate config, print bot identity
botlane run --model grok-3-mini        # start the local bridge
botlane send 123456789 "Hello"         # one-off message from the bot
botlane chat "What is 2+2?"            # one-off completion via hosted API
botlane health                         # check a hosted instance

MCP server

The npm package ships a dependency-free Model Context Protocol server (botlane-mcp) so agent runtimes (Cursor, Claude Code, OpenCode, Codra) can drive the bot directly. Tools: botlane_check, botlane_send, botlane_history, botlane_reset, botlane_chat.

Develop

git clone https://github.com/talocode/botlane
cd botlane/python
pip install -e .
python -m botlane.cli check

Related packages

Package Install
BotLane (this package) pip install talocode-botlane
Tera pip install talocode-tera
Codra pip install talocode-codra
SearchLane pip install talocode-searchlane
StackLane pip install talocode
ContextLane pip install contextlane
ScreenLane pip install talocode-screenlane
Tradia pip install tradia
DevTool pip install talocode-devtool
XProLane pip install talocode-xprolane

Talocode ecosystem

Product Repo Notes
BotLane talocode/botlane (this package) Telegram bridge for Grok bots
Tera talocode/tera Hosted writing/coding capability API
Codra talocode/codra Coding agent runtime
SearchLane talocode/searchlane Agent web search & research
StackLane talocode/stacklane Cloud control plane, keys, wallet
GateLane talocode/gatelane Policy / gate tooling
ContextLane talocode/contextlane Context infrastructure
ScreenLane talocode/screenlane Screen/agent UI tooling
MemoryLane talocode/memorylane Memory for agents
Tradia talocode/tradia Trading tooling
DevTool talocode/devtool Developer utilities
XProLane talocode/xprolane X Pro setup & signal dashboard
XSearchLane talocode/xsearchlane Realtime X search MCP/API
Agent Browser talocode/agent-browser Browser automation API
InvoiceLane talocode/invoicelane Invoicing
GeoLane talocode/geolane Geo visibility
ClipLoop talocode/cliploop Short-form video loop

More: github.com/talocode · talocode.site · docs.talocode.site

Links

License

MIT © Talocode

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

talocode_botlane-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

talocode_botlane-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file talocode_botlane-0.1.0.tar.gz.

File metadata

  • Download URL: talocode_botlane-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for talocode_botlane-0.1.0.tar.gz
Algorithm Hash digest
SHA256 657b5dade6d221b23b16ef154259a0c6e50ef843b03749d86340bef12425a45c
MD5 2eb92aa7fa968ab78a79a3b1420332ac
BLAKE2b-256 b673527921bae6cb02d4f9f564a890456f01a75ea3bcc18e1744c1c1e8b64522

See more details on using hashes here.

File details

Details for the file talocode_botlane-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for talocode_botlane-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a97fe045fa755aee34fc9c06b909071d615d89c7019e183a965139c40322978e
MD5 5a3bc6d08ad916fe653c88e9f3cd9162
BLAKE2b-256 da544d29cefe39d26072c82e39423604eead4c47a2f10701521f3f682237bb56

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page