Step-by-Step Guide to Creating a Telegram Bot and Getting User ID & Token
📌 Step-by-Step Guide to Creating a Telegram Bot and Getting User ID & Token
To receive trade alerts via Telegram, you need:
✅ A Telegram Bot (to send messages)
✅ A Telegram Chat/User ID (to receive messages)
✅ A Bot Token (to authenticate your bot)
🔹 1️⃣ Create a Telegram Bot
- Open Telegram and search for
@BotFather
- Click on BotFather and tap
Start
- Type
/newbot
and pressEnter
- Follow BotFather’s prompts:
- Bot Name: Any name (e.g.,
ExcelAlgoBot
) - Username: Must end in
_bot
(e.g.,excelalgo_bot
)
- Bot Name: Any name (e.g.,
- BotFather will generate an API Token
- Example:
✅ Save this token securely.
🔹 2️⃣ Get Your Telegram User ID
Your User ID is needed to receive bot messages.
Method 1: Using @userinfobot
- Open Telegram and search for
@userinfobot
- Click
Start
- The bot replies with your User ID
- Example:
Your Telegram ID: 987654321
- Example:
✅ Save this User ID.
🔹 3️⃣ Send a Test Message to Yourself
- Open your browser
- Type this URL, replacing
BOT_TOKEN
andUSER_ID
: - If successful, you’ll receive a “Hello from Excel Algo Bot!” message in Telegram.
🔹 4️⃣ Configure the Bot in Your Trading System
- Enter the
BOT_TOKEN
andUSER_ID
in yourtelegram_credentials.json
file - Restart the system to enable Telegram alerts
🎯 Summary
Step | Action | Output |
---|---|---|
1️⃣ Create Bot | Use @BotFather |
Get Bot Token |
2️⃣ Get User ID | Use @userinfobot |
Get User ID |
3️⃣ Send Test Message | Use Telegram API | Confirm Bot Works |
🚀 Your Telegram bot is now ready to send trade alerts!
Need help integrating this into your system? Let me know! 😊