Skip to main content

Setup Bot Mini App

Overview

This guide explains how to configure a Telegram bot you've already created using @BotFather so that it can launch a Telegram Mini App (essentially, opening a web application within Telegram). This allows users to interact with your web-based service directly from the chat interface. Reading this will help you:

  • Navigate the @BotFather settings for an existing bot following the original step sequence.
  • Configure the bot's Menu Button to launch your Mini App URL.
  • Enable and configure the Mini App feature itself within BotFather.
  • Understand the final steps to access your Mini App via the bot.
  • Find answers to common questions about this setup process.

Steps to Configure Your Bot's Mini App

Ensure you have already created your bot using @BotFather and have its unique username and token. You will also need the URL of the web application you want the Mini App to display (this is referred to as "URL (copied from your project)" in the steps below).

  1. Open BotFather: Open your Telegram app (desktop or web).

  2. Search BotFather: Search for @BotFather in the search bar.

    Search for BotFather

  3. Start Chat: Start the chat with BotFather by clicking the Start button if you haven't interacted with it recently.

    Start BotFather Chat

  4. List Your Bots: Send the command /mybots to BotFather.

    Send /mybots command

  5. Select Bot & Settings: BotFather will list your bots. Choose the specific bot you want to configure from the list presented (usually by clicking its username button). Then, from the bot's main menu, select the Bot Settings option.

    Choose Bot and Bot Settings

  6. Select Menu Button Option: In Bot Settings, choose the Menu Button option.

    Choose Menu Button option

  7. Configure Menu Button URL & Text:

    • Choose the Configure Menu Button option.

    • BotFather will ask for the URL. Send the URL of your Mini App's web application (e.g., https://yourapp.yourdomain.com/). Replace [Your Mini App URL] below with your actual URL.

      • [Your Mini App URL]

      Config Menu Button

    • BotFather will then ask for the button text. Send the text you want displayed on the menu button (e.g., Play, Launch App, Open DApp).

  8. Go Back: After setting the menu button text, BotFather will show the updated settings. Choose the « Back to Bot option.

    Back to Bot option

  9. Select Configure Mini App: Now, choose the Configure Mini App option.

    Configure Mini App option

  10. Enable Mini App & Set URL:

    • Choose Enable Mini App.

    • BotFather will again ask for the URL. Send the same URL of your Mini App's web application as you used for the menu button.

      • [Your Mini App URL]

      Enable Mini App

  11. Initiate App Details Setup: Send the command /newapp to BotFather and select your bot from the list when prompted.

    Send /newapp command

  12. Enter App Details: Follow BotFather's prompts to enter a Title, Short Description, and upload a Photo (or GIF) for your Mini App. This improves how your app looks when shared or launched.

    Enter App Title, Description, Photo

  13. Confirm App URL: BotFather might ask for the URL again here. Send the same Mini App URL.

  14. Enter App Short Name: Enter a short name (like an alias) for your app when prompted. The source suggests using app.

    Enter App Short Name

=> BotFather will confirm: You have now completed the mini app setup.

Accessing Your Mini App

Users can now access your Mini App in a few ways:

  • Search for your Bot: Find your bot by its username (Your bot's name) in Telegram search.
  • Menu Button: Open the chat with your bot and press the Menu Button you configured (e.g., "Launch App").
  • Attachment Menu: Press the button next to attach picker to launch your Telegram Mini App in messenger
  • Direct Link: Use a special direct link format (replace YourBotsUsername with your bot's actual username):
    • t.me/YourBotsUsername/app

Q&A (FAQs)

  • Q1: What is a Telegram Mini App?
    • A: It's a way to open and interact with web applications (like websites, DApps, games) directly within the Telegram chat interface, launched via a bot.
  • Q2: Do I need to host the web application myself?
    • A: Yes. The URL you provide to BotFather must point to a live, publicly accessible web application that is optimized for mobile viewing and potentially integrated with Telegram's Mini App SDK for enhanced features.
  • Q3: What's the difference between setting the Menu Button URL and Enabling the Mini App URL?
    • A: Setting the Menu Button specifically links that button to your web app URL. Enabling the Mini App makes the web app accessible through other standard Telegram UI elements like the attachment menu and allows for direct t.me/YourBotUsername/app links to work correctly. You generally need to do both and use the same URL.
  • Q4: Can I change the Mini App URL or settings later?
    • A: Yes, you can usually go back into /mybots -> Bot Settings -> Menu Button or Configure Mini App in BotFather to update the URL or button text if needed. You can also use /editapp after /mybots to change the title, description, photo, etc.

Troubleshooting

  • Q: BotFather doesn't recognize my bot when I use /mybots.
    • A: Ensure you created the bot using the same Telegram account you are currently using to talk to BotFather.
  • Q: The Menu Button or Mini App link opens a blank page or shows an error.
    • A: Double-check that the URL you provided to BotFather is correct, publicly accessible, and points to a functional web application. Ensure your web app doesn't have restrictions preventing it from being loaded in an iframe (which Telegram uses). Test the URL directly in a mobile browser.
  • Q: I can't find the "Configure Mini App" option in Bot Settings.
    • A: Telegram features evolve. Ensure your Telegram app is updated. If the option has moved or changed names, explore the other settings within Bot Settings or check Telegram's official bot documentation for the latest methods. It might also be under Edit Bot.
  • Q: The /newapp command doesn't work or asks for details I don't have.
    • A: The /newapp command is generally for setting the app's metadata (title, description, photo). Ensure you selected the correct bot after typing the command. If it asks for information irrelevant to a simple web app link, you might be able to skip optional parts like the photo initially. Focus on providing the Title, Description, and URL.