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)
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.
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.
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.
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 |
---|---|---|
Use @BotFather |
Get Bot Token | |
Use @userinfobot |
Get User ID | |
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!