Python Telegram Bot - Beginner Friendly
Automatically search and share AliExpress products with affiliate links through Telegram!
📱 Created by Tech Mouad 📺 YouTube: https://www.youtube.com/@techmouad 📸 Instagram: https://www.instagram.com/tech_mouad/ ☕ Support: https://buymeacoffee.com/techmouad Subscribe for more automation tools! 🚀
Before: ❌ Manual product search = Hours of work
After: ✅ Just send a message to bot = Get products instantly! ☕
- 🔍 Smart Product Search - Find any product on AliExpress
- 🔗 Automatic Affiliate Links - Generate commission links instantly
- 📱 Easy Telegram Interface - Just chat with the bot
- � Product Details - Get prices, images, and descriptions
- 📊 Real-time Results - Fast and accurate search results
- Go to python.org
- Download and install Python
⚠️ IMPORTANT: Check "Add Python to PATH" during installation
- Click the green "Code" button above → "Download ZIP"
- Extract the ZIP file to your Desktop
- Open Command Prompt (Windows) or Terminal (Mac/Linux)
- Type these commands:
cd Desktop/AliexpressBot pip install -r requirements.txt
- Open Telegram and message @BotFather
- Send
/newbotand follow instructions - Choose a name and username for your bot
- Copy the token BotFather gives you (keep it safe!)
- Go to AliExpress Open Platform
- Sign up/login with your account
- Create a new application
- Copy your App Key and App Secret
- Find the file called
.env.examplein your bot folder - Rename it to
.env(remove the .example part) - Open the
.envfile and fill in your information:TELEGRAM_BOT_TOKEN=paste_your_bot_token_here ALIEXPRESS_API_PUBLIC=paste_your_app_key_here ALIEXPRESS_API_SECRET=paste_your_app_secret_here
- Open Command Prompt/Terminal
- Navigate to your bot folder:
cd Desktop/AliexpressBot - Run the bot:
python Bot.py - Your bot is now running! Test it on Telegram
Make your bot accessible from anywhere!
- Go to ngrok.com and create free account
- Download ngrok for your system
- Extract ngrok to your bot folder
- Open Command Prompt in your bot folder
- Run:
(Get your token from ngrok dashboard)
ngrok authtoken YOUR_NGROK_TOKEN
- First, run your bot:
python Bot.py - Open another Command Prompt and run:
ngrok http 5000 - Copy the https URL ngrok gives you (looks like:
https://abc123.ngrok.io)
- Add this line to your
.envfile:WEBHOOK_URL=https://your-ngrok-url.ngrok.io/webhook - Restart your bot
🎉 Your bot is now accessible from anywhere!
Want your bot to work even when your PC is OFF? Use cloud hosting!
Railway (Recommended for beginners)
- Go to railway.app and sign up
- Click "New Project" → "Deploy from GitHub repo"
- Connect this bot repository
- Add environment variables:
TELEGRAM_BOT_TOKENALIEXPRESS_API_PUBLICALIEXPRESS_API_SECRETWEBHOOK_URL(Railway will provide this)
- Deploy automatically!
Render.com
- Sign up at render.com
- Create "New Web Service" from GitHub
- Add environment variables
- Deploy for free
- DigitalOcean - Simple VPS hosting
- Heroku - Easy deployment platform
- AWS/Google Cloud - Enterprise solutions
🎉 Now your bot is TRULY online 24/7! ✅ Works even when your PC is completely off ✅ No ngrok needed ✅ Professional hosting
- Start the bot: Send
/startto your bot on Telegram - Search products: Just type what you're looking for (e.g., "wireless headphones")
- Get affiliate links: The bot automatically generates commission links
- Share with friends: Send the links to earn commissions!
AliexpressBot/
├── Bot.py ← Main bot file
├── requirements.txt ← Dependencies
├── .env.example ← Environment template
├── aliexpress_api/ ← API wrapper
└── README.md ← This guide
"Python not found"
→ Reinstall Python with "Add to PATH" checked
"Bot not responding"
→ Check your bot token is correct in .env file
"API errors"
→ Verify your AliExpress API credentials
"ngrok tunnel closed"
→ Restart ngrok command, URL changes each time
"No products found"
→ Try different search terms or check API limits
- Keep your bot token and API keys private
- Don't share your
.envfile - Test with small searches first
- Monitor your API usage
Watch the complete setup tutorial on our YouTube channel!
- Check our YouTube channel for tutorials: @techmouad
- Follow us on Instagram for updates: @tech_mouad
- Create an issue on GitHub if you find bugs
- Support the project: Buy me a coffee ☕
Made with ❤️ by Tech Mouad
📺 YouTube | 📸 Instagram | ☕ Buy me a coffee
Star this repo if it helped you! ⭐