Telegram Bot Development
Run your own instance of the GAIA Telegram bot. The bot uses long polling, so no webhook or public URL is required.Looking to use GAIA on Telegram as a user? See Using GAIA on Telegram.
Prerequisites
- Node.js 18+ and pnpm
- A Telegram account
- GAIA API running (see Self-Hosting Guide)
Step 1: Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbot - Follow the prompts to choose a name and username for your bot
- Copy the bot token BotFather gives you
Step 2: Register Commands (Optional but Recommended)
Send/setcommands to BotFather, select your bot, then paste:
Step 3: Configure Environment Variables
Create a.env file in apps/bots/telegram/:
Step 4: Start the Bot
Troubleshooting
| Problem | Solution |
|---|---|
| Bot doesn’t respond | Check the bot token is correct and the process is running |
| Commands not showing autocomplete | Run /setcommands with BotFather |
| Authentication fails | Ensure GAIA_BOT_API_KEY matches the API config and the API is reachable |

