Connecting Your Bot

Connect your existing Telegram bot to cThrone in minutes using our transparent proxy architecture.


One Simple Change

To integrate with cThrone, you only need to change the API base URL in your bot's configuration. That's it. cThrone automatically works with both webhooks and getUpdates — no extra actions or code changes required.

The Telegram Bot API operates on two work schemes:

Webhook

When a user writes to the bot, the Telegram server automatically sends an HTTPS request to your bot's address.

getUpdates (Long Polling)

Your bot independently requests updates from the Telegram server at regular intervals.

Good news: cThrone supports both modes out of the box. No configuration needed.


cThrone acts as a transparent proxy between your bot and Telegram. All requests pass through unchanged.

Your Server
API Requests
PROXY
cThrone
Forwarded
Telegram API

All requests — getUpdates, sending messages, files, and more — are proxied to Telegram servers unchanged. cThrone simply observes and logs activity to power your dashboard.


Your Bot URL is available in the dashboard under Bot Settings. Replace api.telegram.org with your unique URL like: https://your-bot-key.cthrone.dev

grammY
Node.js • The modern Telegram Bot Framework
Node.js

Use the client.apiRoot option when creating your bot instance.

const { Bot } = require("grammy");

const bot = new Bot(process.env.BOT_TOKEN, {
  client: {
    // We accept the drawback of webhook replies for type safety.
    apiRoot: "https://your-bot-key.cthrone.dev",
  },
});

bot.start();
Telegraf
Node.js • Most popular Telegram bot framework
Node.js

Set the apiRoot option when creating your bot instance.

const { Telegraf } = require('telegraf');

const bot = new Telegraf(process.env.BOT_TOKEN, {
  telegram: {
    apiRoot: 'https://your-bot-key.cthrone.dev'
  }
});

bot.launch();
node-telegram-bot-api
Node.js • Lightweight Telegram Bot API wrapper
Node.js

Use the baseApiUrl option in the constructor.

const TelegramBot = require('node-telegram-bot-api');

const bot = new TelegramBot(process.env.BOT_TOKEN, {
  polling: true,
  baseApiUrl: 'https://your-bot-key.cthrone.dev'
});
aiogram
Python • Modern async framework for Telegram bots
Python

Create a custom session with TelegramAPIServer.from_base() and pass it to your Bot instance.

from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer

session = AiohttpSession(
    api=TelegramAPIServer.from_base('https://your-bot-key.cthrone.dev')
)

bot = Bot(token=TOKEN, session=session)
python-telegram-bot
Python • Pure Python interface for the Telegram Bot API
Python

Use the base_url method in the Application builder. Note: append /bot to the URL.

from telegram.ext import Application

application = Application.builder() \
    .token("YOUR_BOT_TOKEN") \
    .base_url("https://your-bot-key.cthrone.dev/bot") \
    .build()
Longman/TelegramBot
PHP • PHP Telegram Bot based on official API
PHP

Call Request::setCustomBotApiUri() before creating the Telegram object.

use Longman\TelegramBot\Request;

// Set custom API URI before creating Telegram object
Request::setCustomBotApiUri('https://your-bot-key.cthrone.dev'); 

$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
telebot
Go • Telegram bot framework written in Go
Go

Set the URL field in the Settings struct.

pref := tele.Settings{
    Token:  os.Getenv("TOKEN"),
    URL:    "https://your-bot-key.cthrone.dev",
    Poller: &tele.LongPoller{Timeout: 10 * time.Second},
}

b, err := tele.NewBot(pref)