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.
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
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();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();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'
});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)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()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);