Problem:
- Selecting Size then Color would reset Size selection
- Users could never get "Add to Cart" button with multiple variant types
- Each selection created a NEW list, wiping previous choices
Root Cause:
- HandleSetVariant created: new List<string> { variantName }
- This replaced all previous selections instead of accumulating
Fix:
1. Get existing selected variants from session
2. Find the variant type of newly selected variant
3. Remove any previous selection from the SAME type (allow changing choice)
4. Add the new selection
5. Save accumulated list back to session
Example behavior now:
- Select "Red" (Color) → selectedVariants = ["Red"]
- Select "Large" (Size) → selectedVariants = ["Red", "Large"] ✅
- Select "Blue" (Color) → selectedVariants = ["Blue", "Large"] ✅
- Can now confirm when all types selected
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| .claude | ||
| BotManagerTestClient | ||
| Scripts | ||
| TeleBot | ||
| TeleBot.Tests | ||
| TeleBotClient | ||
| test-results | ||
| .env.example | ||
| .env.multi.example | ||
| .env.production.example | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| deploy-bot.sh | ||
| DEPLOYMENT.md | ||
| docker-compose.hostinger.yml | ||
| docker-compose.multi.yml | ||
| docker-compose.production.yml | ||
| docker-compose.yml | ||
| INTEGRATION_SUMMARY.md | ||
| MULTI-HOST-DEPLOYMENT.md | ||
| portainer-template.json | ||
| README.md | ||
| TEST_DOCUMENTATION.md | ||
| TESTING-AND-VERIFICATION.md | ||
| TOR-IMPLEMENTATION-SUMMARY.md | ||
TeleBot - Privacy-First E-Commerce Telegram Bot
A privacy-focused Telegram bot for the LittleShop e-commerce platform, featuring anonymous shopping, cryptocurrency payments, and optional Tor support.
🔒 Privacy Features
- No Account Required: Shop anonymously without registration
- Ephemeral Sessions: Data auto-deletes after 30 minutes of inactivity
- PGP Encryption: Optional encryption for shipping information
- Tor Support: Can operate through Tor network for maximum privacy
- Anonymous References: Orders use random identifiers, not user IDs
- Cryptocurrency Only: Bitcoin, Monero, and other privacy coins
- Zero Analytics: No tracking unless explicitly enabled
- Data Deletion: Delete all your data instantly with
/delete
🚀 Quick Start
Prerequisites
- .NET 9.0 SDK
- Telegram Bot Token (from @BotFather)
- LittleShop API running locally or accessible
- (Optional) Redis for persistent sessions
- (Optional) Tor for anonymous routing
Installation
- Clone the repository:
git clone https://github.com/yourusername/littleshop.git
cd littleshop/TeleBot/TeleBot
- Configure the bot:
cp appsettings.json appsettings.Production.json
# Edit appsettings.Production.json with your settings
- Set your bot token:
{
"Telegram": {
"BotToken": "YOUR_BOT_TOKEN_FROM_BOTFATHER"
},
"LittleShop": {
"ApiUrl": "https://localhost:5001",
"Username": "bot-user",
"Password": "bot-password"
}
}
- Run the bot:
dotnet run --environment Production
📱 Bot Commands
Shopping Commands
/start- Start shopping and view main menu/browse- Browse product categories/cart- View your shopping cart/orders- View your order history/clear- Clear shopping cart
Privacy Commands
/privacy- Privacy settings menu/ephemeral- Toggle ephemeral mode/pgpkey [key]- Set PGP public key for encryption/delete- Delete all your data immediately/tor- Get Tor configuration instructions
Help
/help- Show all available commands
🛍️ Shopping Flow
-
Browse Products
- Start with
/browseor main menu - Select category → View products → Select product
- Start with
-
Add to Cart
- Choose quantity with +/- buttons
- Click "Add to Cart"
- Continue shopping or checkout
-
Checkout
- Click "Proceed to Checkout" from cart
- Enter shipping information step-by-step:
- Name
- Address
- City
- Postal Code
- Country
- Review and confirm order
-
Payment
- Select cryptocurrency (BTC, XMR, USDT, etc.)
- Receive wallet address and amount
- QR code generated for easy payment
- Payment expires after set time
-
Order Tracking
- Use
/ordersto view all orders - Click on order to see details
- Track payment and shipping status
- Use
🔐 Privacy Configuration
Ephemeral Mode (Default: ON)
{
"Privacy": {
"EphemeralByDefault": true,
"DataRetentionHours": 24,
"SessionTimeoutMinutes": 30
}
}
PGP Encryption
Users can enable PGP encryption for shipping information:
/pgpkey -----BEGIN PGP PUBLIC KEY BLOCK-----
[Your PGP public key here]
-----END PGP PUBLIC KEY BLOCK-----
Tor Configuration
Enable Tor routing for all bot communications:
{
"Privacy": {
"EnableTor": true,
"TorSocksPort": 9050,
"TorControlPort": 9051
}
}
Redis Session Storage (Optional)
For non-ephemeral sessions across bot restarts:
{
"Redis": {
"Enabled": true,
"ConnectionString": "localhost:6379",
"InstanceName": "TeleBot"
}
}
🧅 Tor Setup
1. Install Tor
# Ubuntu/Debian
sudo apt install tor
# Start Tor service
sudo systemctl start tor
2. Configure Hidden Service
Edit /etc/tor/torrc:
HiddenServiceDir /var/lib/tor/telebot/
HiddenServicePort 80 127.0.0.1:5000
HiddenServiceVersion 3
3. Get Onion Address
sudo cat /var/lib/tor/telebot/hostname
4. Configure Bot
{
"Privacy": {
"EnableTor": true,
"OnionServiceDirectory": "/var/lib/tor/telebot/"
},
"LittleShop": {
"OnionUrl": "http://your-shop-onion.onion",
"UseTor": true
}
}
🚢 Deployment
Docker
FROM mcr.microsoft.com/dotnet/runtime:9.0
WORKDIR /app
COPY ./publish .
ENTRYPOINT ["dotnet", "TeleBot.dll"]
Docker Compose with Tor
version: '3.8'
services:
telebot:
build: .
environment:
- ASPNETCORE_ENVIRONMENT=Production
- Privacy__EnableTor=true
volumes:
- ./appsettings.Production.json:/app/appsettings.Production.json
- ./data:/app/data
depends_on:
- tor
- redis
tor:
image: dperson/torproxy
ports:
- "9050:9050"
- "9051:9051"
volumes:
- ./tor:/etc/tor
- tor_data:/var/lib/tor
redis:
image: redis:alpine
command: redis-server --save ""
volumes:
- redis_data:/data
volumes:
tor_data:
redis_data:
Systemd Service
[Unit]
Description=TeleBot Privacy E-Commerce Bot
After=network.target
[Service]
Type=simple
User=telebot
WorkingDirectory=/opt/telebot
ExecStart=/usr/bin/dotnet /opt/telebot/TeleBot.dll
Restart=on-failure
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
🔧 Advanced Configuration
Supported Cryptocurrencies
{
"Cryptocurrencies": [
"BTC", // Bitcoin
"XMR", // Monero (recommended for privacy)
"USDT", // Tether
"LTC", // Litecoin
"ETH", // Ethereum
"ZEC", // Zcash
"DASH", // Dash
"DOGE" // Dogecoin
]
}
Order Mixing (Privacy Feature)
Adds random delays to order processing:
{
"Features": {
"EnableOrderMixing": true,
"MixingDelayMinSeconds": 60,
"MixingDelayMaxSeconds": 300
}
}
Disappearing Messages
Auto-delete sensitive messages after display:
{
"Features": {
"EnableDisappearingMessages": true,
"DisappearingMessageTTL": 30
}
}
📊 Monitoring
Logs
- Console output for real-time monitoring
- File logs in
logs/telebot-YYYYMMDD.txt - Privacy-safe logging (no PII)
Health Check
curl http://localhost:5000/health
🔒 Security Best Practices
- Never commit real bot tokens - Use environment variables
- Run as non-root user in production
- Use HTTPS for API connections
- Enable Tor for maximum privacy
- Rotate bot tokens regularly
- Monitor for abuse - Implement rate limiting
- Backup PGP keys securely
- Use strong passwords for API authentication
🐛 Troubleshooting
Bot not responding
- Check bot token is correct
- Ensure bot is not blocked
- Check network connectivity
- Review logs for errors
Can't connect to API
- Verify LittleShop API is running
- Check API credentials
- Test API connection manually
- Check firewall rules
Tor connection issues
- Ensure Tor service is running
- Check SOCKS proxy settings
- Verify onion address is correct
- Check Tor logs:
sudo journalctl -u tor
Session issues
- Clear Redis cache if enabled
- Delete
telebot.dbif using LiteDB - Restart bot service
- Check session timeout settings
📝 Privacy Policy
This bot implements privacy-by-design principles:
- Minimal data collection
- Ephemeral by default
- No third-party tracking
- User-controlled data deletion
- Optional encryption
- Anonymous identifiers
- No KYC requirements
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📄 License
This project is part of the LittleShop platform. All rights reserved.
🆘 Support
- Open an issue on GitHub
- Contact via Telegram: @yoursupport
- Email: support@littleshop.onion (Tor)
🔮 Roadmap
- Voice message support for product search
- Group shopping carts
- Multi-language support
- Web app integration
- Lightning Network payments
- Decentralized order storage (IPFS)
- AI-powered product recommendations
- End-to-end encrypted group orders
Remember: Your privacy is our priority. Shop safely! 🔒