Telegram API Key Walkthrough
Simple Step-by-Step Guide
Step 1: Create Your Telegram Bot
- Open Telegram and start a chat with BotFather. 
- Type the command - /newbotto create a new bot.
- Follow the prompts to: - Set a name for your bot. 
- Set a unique username (must end in - bot).
 
- Once done, you’ll receive a bot token (e.g., - 123456789:ABCdefGhIjKlmNoPQRstuVWXyz).
More detailed tutorial here - core.telegram.org/bots/tutorial
Keep this token secure. You’ll use it later on aigent.run.

Step 2: Add Bot Token to aigent.run
- Visit aigent.run and go to the Configuration tab. 
- Paste your bot token into the Bot Token field. 
- Click Save. 
- Use the Test Credentials button to check that the bot is connected correctly. 

Step 3: Add the Bot to a Telegram Group
- Create a new Telegram group or use one where you're already an admin. 
- Add your newly created bot to the group. 
- Once added, tap the group name → Manage Group → Administrators. 
- Promote your bot to Administrator status. 

Step 4: Get the Group Chat ID
To get the chat ID you have to follow these steps:
- Add @myidbot to the group you want to enable the agent in, and make it an Admin. 
- Contact the @myidbot bot and send the - /getidcommand to get your personal chat ID, or invite it into a group and use the- /getgroupidcommand to get the group chat ID.
- To get the Thread ID, the easiest way is this: Post a message to that topic, then right-click on it and select - Copy Message Link. Paste it on a notepad and notice that it has the following structure- https://t.me/c/XXXXXXXXXX/YY/ZZ. The Thread ID is- YY(integer).

Step 5: Add the Chat ID to aigent.run
- Go back to the Configuration tab on aigent.run. 
- Paste the Chat ID into the appropriate field. 
- Click Send Test Message. 
If everything is set up correctly, you’ll receive a message in your Telegram group saying:
"This is a test message from your AIgent."

That’s it! Your Telegram bot is now ready to send messages through aigent.run.
Last updated
