Deploy to Render.com (Free 24/7 Hosting)
Step 1: Create Render Account
- Go to https://render.com
- Sign up with your GitHub account
Step 2: Push Code to GitHub
cd C:\Users\abbasyk\Documents\opencode-hf-space
git init
git add -A
git commit -m "Initial commit"
git remote add origin https://github.com/YOUR_USERNAME/opencode-bot.git
git push -u origin main
Step 3: Create Background Worker on Render
- Go to https://dashboard.render.com
- Click "New +" → "Background Worker"
- Connect your GitHub repo
- Settings:
- Name: opencode-telegram-bot
- Runtime: Node
- Build Command:
npm install - Start Command:
node bot.js
- Click "Advanced" → Add these Environment Variables:
| Key | Value |
|---|---|
TELEGRAM_BOT_TOKEN |
8835963099:AAHvLdFqbpsfDs3hTUBXuFQzSo3LSpedd6k |
TELEGRAM_CHAT_ID |
6922119748 |
OPENCODE_ZEN_KEY |
sk-1IwuYl2EKD0bNtmoEPqBVuWQHlKlc7gN5VLFZnjBrGTUbg7O1376dM9eYg8AHaUv |
- Click "Create Background Worker"
Step 4: Verify
- Go to your service page on Render
- Check "Logs" tab - you should see:
[OK] Starting Telegram bot... [OK] Telegram bot is running!
Free Tier Limitations
- 750 hours/month (enough for 24/7)
- Sleeps after 15 min of inactivity (but Telegram bot keeps it awake)
- Spins up in ~30 seconds when new message arrives
Alternative: Fly.io
If Render doesn't work, try Fly.io:
- Install:
curl -L https://fly.io/install.sh | sh - Run:
fly auth login - Run:
fly launch - Run:
fly secrets set TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... OPENCODE_ZEN_KEY=... - Run:
fly deploy