Skip to content

Developers

You can build bots on Neaptun: bots receive messages in direct chats and groups, send messages with buttons, cards, forms and games, and open their own web pages as mini apps.

Last updated: 17 November 2026

Creating a bot

Bots are created under Settings > Developer > My bots (web, Windows and Android). One account can create up to 10 bots.

A bot's username ends in "bot" (for example weather_bot) and uses lowercase letters, digits and underscores. The bot access token is shown only once; if you lose it, generate a new one and the old token stops working immediately.

Bot API

A bot sends JSON POST requests to https://neaptun.com/api/bot/v1/<method> with the header "Authorization: Bot <token>". Responses always have the form { ok, result } or { ok: false, error }.

Updates arrive in one of two ways: long polling (getUpdates; the queue is kept for 24 hours) or a webhook. The webhook address must be https; every request carries a timestamp and an HMAC-SHA256 signature, and a failed delivery is retried after 2, 10 and 30 seconds. Redirects are not followed and local or private network addresses are refused.

  • Messages: sendMessage, editMessageText, editMessageReplyMarkup, deleteMessage, sendChatAction
  • Buttons and commands: answerCallbackQuery, setMyCommands, getMyCommands
  • Chats: getChat, getChatMember, getMe
  • Inline queries (@botname query): answerInlineQuery
  • Mini apps: answerWebAppQuery
  • Games: sendGame, setGameScore, getGameHighScores
  • Attachments: getFile

What a message can contain

Besides plain text, a bot message can carry:

  • Inline buttons: callback to the bot, link (opened after the user confirms), copy to clipboard, mini app
  • Message cards (up to 10 per message), select menus and forms
  • Commands with options: in groups they come from the command picker and are not posted to the channel
  • Ephemeral messages visible to a single user (not stored)
  • Game cards with a high score table (the game opens in the bot's mini app)

Mini apps

A bot can host a web page on its own https address. The address is verified with a /.well-known/neaptun-miniapp.json file at the site root; an unverified address does not open. Neaptun's own domains cannot be used as a mini app address.

When it opens, the page receives initData signed with Ed25519 that says who opened it (valid for 24 hours); the bot's server must verify the signature with the public key at https://neaptun.com/api/miniapp/public-key. The link https://neaptun.com/app/<botname>?startapp=<value> opens the mini app directly.

Screen capture is disabled in mini apps. Camera and microphone are disabled on the web and in the Windows app; in the Android app they are available only after the user allows them for that mini app.

Rules and privacy

Bots are restricted to protect users' trust:

  • A bot cannot start a conversation: the user has to write first or share a group with the bot.
  • Only members who can manage members can add a bot to a group. With privacy mode on (the default) a bot only sees commands, messages that mention it and replies to it.
  • Direct messages to a bot without a device key are not end-to-end encrypted; the app shows this with a "not encrypted" badge in the chat. A bot that registers device keys (up to 3 devices) can receive and send encrypted messages; in encrypted group channels only such a bot can read messages.
  • Bots never receive users' e-mail addresses, last seen or online status.
  • Rate limits: 30 requests per second per bot; 1 message per second per chat (short bursts of 3) and 20 messages per minute per group.

Bot directory

A bot owner can list the bot in the directory with a category and a short description. The directory is only open to signed-in users; bots that break the rules can be hidden from the directory or disabled.

Contact

For questions about the bot platform and security reports, write to info@3yolyazilim.com.