Logo Lanfrica

dev-merit01/radio-zimbabwe-chatbot

Type de record:

software
Créateur:
dev
Hôte:
a top 50 voting whatsapp chatbot for ZBC (Radio Zimbabwe) # Radio Zimbabwe Voting Bot Multi-channel chatbot to collect up to 5 votes per user per day, verified via Spotify, and generate a daily Top 100 chart. Supports both Telegram and WhatsApp (via OneMsg.io). > **Deployment Test:** Last updated January 7, 2026 - Testing render.com auto-deploy pipeline. ## Setup 1. Create `.env` from `.env.example` and fill secrets. 2. Install dependencies. 3. Run migrations and start server. ## Commands (Windows PowerShell) ``` python -m venv .venv . .venv\Scripts\Activate.ps1 pip install -r requirements.txt python manage.py migrate python manage.py runserver 0.0.0.0:8000 ``` ### Local DB (SQLite by default) The `.env.example` defaults to `DATABASE_URL=sqlite:///db.sqlite3`, which is perfect for local development. No extra setup required. ### Switching to PostgreSQL for deployment Update your `.env` to point to Postgres and re-run migrations: ``` DATABASE_URL=postgres:// : @ :5432/ REDIS_URL=redis:// :6379/0 ``` Then: ``` python manage.py migrate ``` ## Webhook (Telegram) ### Local Testing You have two options locally: **Polling (no public URL required)** ``` python manage.py run_telegram_bot ``` Send a message to your bot and you should receive an immediate reply. Stop the command with `CTRL+C`. **Webhook with ngrok** 1. Install ngrok: `choco install ngrok` (or download from ngrok.com) 2. Run ngrok: `ngrok http 8000` 3. Copy the HTTPS URL (e.g., `abc123.ngrok.io`) 4. Test bot token: `python manage.py test_telegram_bot` 5. Set webhook: `python manage.py set_telegram_webhook abc123.ngrok.io` ### Production Set your bot webhook to `https:// /webhook/telegram/`. Incoming messages should include `message.chat.id` and `message.text`. Use `python manage.py delete_telegram_webhook` to disable it if migrating to polling. ## WhatsApp (OneMsg.io) ### Setup 1. Register at app.onemsg.io 2. Connect your WhatsApp by scanning the QR code in "My Device" 3. Create an application in …