Skip to content

feat: Managed Bots support (Bot API 9.6)#793

Open
matvievsky wants to merge 1 commit into
go-telegram-bot-api:masterfrom
matvievsky:feat/managed-bots
Open

feat: Managed Bots support (Bot API 9.6)#793
matvievsky wants to merge 1 commit into
go-telegram-bot-api:masterfrom
matvievsky:feat/managed-bots

Conversation

@matvievsky

Copy link
Copy Markdown

Summary

  • Adds types and methods for Telegram's Managed Bots feature (Bot API 9.6, April 2026): a bot with can_manage_bots can create and control other bots via its own token — no BotFather /newbot dance, no separate credential per bot.
  • User.CanManageBots (getMe)
  • Update.ManagedBot / ManagedBotUpdated — creation, token update, or owner update of a managed bot
  • Message.ManagedBotCreated / ManagedBotCreated — service message for bot creation
  • BotAPI.GetManagedBotToken(userID) / BotAPI.ReplaceManagedBotToken(userID)

Used this in production to let our own bot spin up disposable debug/staging bots on demand instead of manually walking through BotFather each time.

Not included

KeyboardButtonRequestManagedBot and savePreparedKeyboardButton (the Mini App / deep-link half of the same API bump) aren't covered — happy to extend this PR or follow up separately if there's interest.

Test plan

  • go build ./...
  • Exercised GetManagedBotToken/ReplaceManagedBotToken against the live Bot API in a real managed-bot flow

Adds the types and methods for Telegram's Managed Bots feature, introduced
in Bot API 9.6 (April 2026): a bot with can_manage_bots can create and
control other bots via its own Bot API token, without BotFather's manual
/newbot flow or a separate credential per bot.

- User.CanManageBots (getMe)
- Update.ManagedBot / ManagedBotUpdated (creation, token update, or owner
  update of a managed bot)
- Message.ManagedBotCreated / ManagedBotCreated (service message for bot
  creation)
- BotAPI.GetManagedBotToken(userID) — fetch a managed bot's current token
- BotAPI.ReplaceManagedBotToken(userID) — rotate a managed bot's token

Doesn't add KeyboardButtonRequestManagedBot or savePreparedKeyboardButton
(the Mini App integration half of the same API bump) — happy to extend this
PR or follow up separately if there's interest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant