Skip to main content
Telegram bots are a great use case for Action Codes — users can interact with blockchain actions directly in chat.

The flow

  1. User starts chat with your bot
  2. Bot asks for an action code
  3. User gets code from actioncode.app and sends it
  4. Bot attaches an action (transaction or message)
  5. User approves in actioncode.app
  6. Bot confirms completion

Example bot

Using grammY (works similarly with other libraries):

State management helpers

Transaction example

For sending SOL:

User experience tips

  1. Guide users clearly — Not everyone knows what actioncode.app is
  2. Show progress — Send messages at each step
  3. Handle timeouts gracefully — Codes expire in ~2 minutes
  4. Confirm success — Show the result clearly

Live example

Try the official example bot: @action_codes_bot Source code: github.com/otaprotocol/telegram-bot-example