Build bots for KyaChat

Bots are KyaChat accounts run by your code. They chat with people, post to channels and offer buttons for orders, bookings and reminders.

Three steps to a working bot

  1. Create the bot

    In KyaChat Web, open Settings, then Bots. Choose a name and an @username. KyaChat shows the bot’s token once, so copy it somewhere safe.

  2. Get updates

    Call getUpdates to collect new messages and button taps, or call setWebhook and KyaChat posts them to your HTTPS server.

  3. Reply

    Answer with sendMessage, add buttons with reply_markup, and update the message later with editMessageText.

One HTTPS call per action

Create a bot in Settings, then send messages, buttons, photos and files over a simple HTTPS API. Collect updates with long polling or a webhook.

The bot message as people see it in KyaChat, with its buttons

Good to know

  • The token is shown once and stored only as a hash. Rotate it in Settings and the old one stops working at once.
  • A bot can write to someone only after that person has messaged it. In groups and channels it must be a member.
  • Up to 120 calls every 10 seconds per bot. Above that the API answers 429 with a retry_after value.
  • Webhooks must use HTTPS, are retried with back-off when your server fails, and can carry a secret you check on every request.
  • In a group a bot receives every message, so tell members what your bot does with them.
  • Up to 20 bots per person.

Full Bot API reference