Sensever bots: moving from Telegram
If you have a Telegram bot, you can run it in Sensever almost unchanged: Sensever understands the Telegram Bot API. This article is a step-by-step migration plan and a list of what works differently.
Step 1. Create a bot in Sensever
The bots window plays the role of BotFather: Chats → "Create" → "Bot". As in Telegram, the username ends in _bot; if your Telegram bot's name is free in Sensever, take the same one. Save the b1.… token and the webhook secret.
BotFather | Sensever |
|---|---|
| "Create" → "Bot" |
| "Actions" → "New token" |
| "Actions" → "Description" or |
| "Actions" → "Avatar" |
|
|
| "Actions" → "Privacy in groups" |
| "Actions" → "Inline mode" |
| "Actions" → "Remove bot" |
| None: a group admin adds the bot to the group |
| Not needed: |
Step 2. Build the token for your library
Telegram libraries check the token format <number>:<string>. Build it from the bot_id and the part of the token after b1.:
curl -s https://api.sensever.com/v1/chat/bot/me -H "Authorization: Bearer b1.AbCd…"
# {"id":"812",...} → token for the library: 812:AbCd…Step 3. Change the base URL
Library | Setup |
|---|---|
aiogram 3 |
|
python-telegram-bot |
|
grammY |
|
Telegraf |
|
An aiogram 3 example:
from aiogram import Bot, Dispatcher
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
from aiogram.filters import CommandStart
from aiogram.types import Message
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.sensever.com"))
bot = Bot("812:AbCd…", session=session)
dp = Dispatcher()
@dp.message(CommandStart())
async def start(message: Message):
await message.answer("Hi! I'm running on Sensever.")
@dp.message()
async def echo(message: Message):
await message.answer(message.text or "Got your file")
dp.run_polling(bot)Step 4. Check what you use
The adapter supports the core methods: updates and webhook, sending text and files, editing and deleting, polls, reactions, "typing…", inline buttons and the keyboard, commands, descriptions, inline mode and basic group administration. The full list with parameters is in "Bot API: Telegram-compatible adapter". Methods outside the list return 404, and the library throws an exception: find such calls in advance.
Common places you will need to change:
In Telegram | In Sensever |
|---|---|
| Send files one at a time or with the native API: up to 10 files in one message |
| Not available. To send the same file, use its |
| Not available |
| Not available; text and buttons can be changed |
| Not available: neither people nor bots can pin messages yet |
| Not available |
| Not available: the owner and human admins manage these |
| Not available: send a message from the server |
Payments ( | Not available |
| Use |
| Not available: only |
Quiz polls, multiple-answer polls, anonymous polls | Not available: only a regular single-answer poll, not anonymous |
Commands for | Only |
Step 5. Account for data differences
chat.idis the conversation number in Sensever, not in Telegram. Savedchat_idvalues from Telegram will not work: conversations with people start over.from.idis the person's number in Sensever. You cannot link Telegram and Sensever accounts byid.A group has the type
supergroup; there is nogrouptype.message_reactionarrives separately for each change: one reaction innew_reactionor inold_reaction.An empty
allowed_updatesin Sensever enables all types, includingchat_memberandmessage_reaction, which Telegram does not send by default.reply_to_messagecontains onlymessage_id,chatanddate. To read the full original message, use the native API:GET /v1/chat/threads/{chat_id}/messages/{message_id}.Text can be up to 16,384 characters instead of 4096.
A Mini App opens in a new browser tab, and the data is signed with the webhook secret, not the token.
Step 6. Launch
Start the bot with the new settings. If the bot uses a webhook, call
setWebhookwith your URL: updates will arrive in Telegram format with theX-Telegram-Bot-Api-Secret-Tokenheader.Open a chat with the bot in Sensever and tap "Start".
Check the delivery log in the bot menu and
getWebhookInfo.Share a link to the bot:
https://sensever.com/@shop_bot, or with a parameter:https://sensever.com/@shop_bot?start=from_telegram.
What the native API adds
The adapter covers what Telegram has. Sensever features that Telegram lacks or implements differently are available through the native Bot API: up to 10 files in one message, large file uploads, replying to website visitors in project requests with handover to an agent, reading conversation history, and mentioning members. One bot can use both APIs at the same time.
Comments