Sensever bots: introduction
A bot in Sensever is an account controlled by a program rather than a person. People message a bot in a direct chat, add it to groups and channels, and choose it as a project assistant so it answers website visitors. Everything that happens to the bot reaches your server as updates, and the server responds through the HTTP API.
This article explains what bots can do and how they work. For step-by-step creation of your first bot, see "Sensever bots: your first bot in 15 minutes". The full method reference is in the "Bot API" series. If you already have a Telegram bot, start with "Sensever bots: moving from Telegram".
What bots can do
Reply to people. A bot receives a message, an edit, a reaction or a button tap and replies with formatted text, files, a poll or buttons.
Run a conversation with buttons. Inline buttons under a message, a keyboard under the input field, a command menu on "/", the "Start" button and links with the
?start=parameter.Work in groups and channels. Respond to commands and mentions, post in a channel on its behalf, delete spam and restrict members if the bot is an admin.
Answer website visitors. A bot can be chosen as a project assistant: it receives requests from the widget until an agent takes them.
Work in any chat through inline mode. A person types
@shop_bot query, picks a result, and the message is sent to the chat marked "via @shop_bot".Open its own web apps. A Mini App button opens the bot's page with signed data about the person.
Understand the Telegram Bot API. Ready-made Telegram libraries (aiogram, python-telegram-bot, grammY, Telegraf) work with a Sensever bot once you change the base URL.
How it works
A person creates a bot in Sensever and receives a token and a webhook secret. The bot belongs to that person.
Everything the bot needs to know becomes an update in its own queue. Each update has an increasing number,
update_id.The bot server fetches updates in one of two ways: it polls the queue itself (
getUpdates, long polling) or receives them at its own HTTPS address (webhook). Both read the same queue, so switching between them loses nothing.The server responds with Bot API calls: it sends messages, edits them, adds reactions and answers button taps.
Person ───► Sensever ───► bot update queue ───► getUpdates or webhook ───► bot server
▲ │
└────────────────────── Bot API (HTTPS) ◄──────────────────────┘The bot server can run anywhere: on your hosting, in a cloud function, on a home computer (with getUpdates you don't need a public address). Sensever doesn't run the bot's code and doesn't see its settings.
Where bots live
Where | How the bot gets there | Which updates it receives |
|---|---|---|
Direct chat | The person opens a chat with the bot themselves | All messages, edits, reactions, button taps and votes in the bot's polls |
Project request (website widget) | The project owner chooses the bot as the assistant | Visitor messages while the request is open and no agent has taken it |
Group | An admin adds the bot as a member | In privacy mode — only commands, mentions and replies to the bot; without it — everything |
Channel | An admin adds the bot as a member | Every post ( |
Any chat | Inline mode is turned on for the bot | The |
Core rules
A bot belongs to a person. It is created without a project; a project only selects the bot in its settings. One person can have up to 20 active bots and needs a verified email or phone in their Sensever account.
The username ends in
_bot. For example,shop_bot. People and channels can't take a name with that ending, so a bot is always recognizable by its address. A bot has a public page athttps://sensever.com/@shop_bot.A bot doesn't write first. The person starts the conversation (the "Start" button), and an admin adds the bot to a group or channel.
A bot sees no more than a member does. Permissions are checked when an update is delivered and on every API call. The bot won't receive a message that was deleted, hidden or restricted by an access policy.
A bot doesn't receive its own actions. Its messages, edits and reactions don't create updates.
A website visitor is anonymous. In project requests, the bot sees the visitor under an opaque reference
tu1.…, not an account number. A person can share their phone number with the bot only themselves, with the "Share phone number" button.
Two APIs to choose from
The native Sensever Bot API — REST: https://api.sensever.com/v1/chat/..., the token in the Authorization: Bearer b1.… header, Sensever objects (a message with thread_id and seq, attachments, polls). It gives you every capability of the platform.
The Telegram-compatible Bot API — https://api.sensever.com/bot<token>/<method>, objects in Telegram format (Update, Message, User, Chat). It's suited to moving an existing bot. It has fewer methods; the differences are described in "Bot API: Telegram-compatible adapter".
Both APIs perform actions with the same code, the same permissions and the same limits. You can mix them: for example, receive updates through the Telegram-compatible getUpdates and send files with the native API.
Where bot UI works
Buttons, the keyboard under the input field, the command menu, inline mode, Mini Apps and text formatting are shown in the Sensever web version. The website widget supports buttons, the keyboard, the command menu and Mini Apps; there's no inline mode in the widget. The Sensever mobile app shows bot messages but currently displays formatting as is.
What's next
"Sensever bots: your first bot in 15 minutes" — from creation to replying with buttons, with examples in curl, JavaScript and Python.
"Bot API: basics" — URLs, authorization, formats, errors and the full list of methods.
"Sensever bots: features and limits" — limits, permissions, privacy and security.
टिप्पणियाँ