Telegram bot for ORC4BIKES, an RC4 interest group
Handles the rental of bicycles from ORC4BIKES.
Using telegram, users are able to check the availability of bikes, and rent them after verification.
| Command | Description |
|---|---|
| /start | Initializes the bot |
| /topup | Top-up via PayLah / PayNow |
| /routes | orc4bikes-curated routes |
| /status | Credits and rental status |
| /history | Recent transactions history |
| /bikes | See available bikes |
| /rent | Start your rental trip here! |
| /getpin | Get the PIN for the bike you rented |
| /return | Return the current bicycle |
| /report | Report damages or anything sus |
-
Download and install Python by following the instructions here. Ensure that the version is at least the major version declared in
src/runtime.txt. -
Install Python modules required.
python3 -m pip install -r requirements.txt
- Additionally, install the
python-dotenvlibrary if you are testing locally.
python3 -m pip install python-dotenv
-
Make a copy of
.env.exampleas.env, then fill in the necessary environment variables. -
Start the bot.
python3 main.py
This bot is designed to run on fly.io for production deployment.
The repository includes GitHub Actions for automatic deployment when you push to the main branch.
Setup (one-time):
- Get your fly.io API token:
flyctl auth token-
Add it to GitHub Secrets:
- Go to your GitHub repository
- Navigate to Settings > Secrets and variables > Actions
- Add a new secret named
FLY_API_TOKENwith your token
-
Push to main branch:
git add .
git commit -m "Deploy changes"
git push origin mainHow it works:
- Any push to
maintriggers automatic deployment - Uses
.github/workflows/fly.ymlconfiguration - Runs
flyctl deploy --remote-onlyon GitHub's servers - Monitor progress in the Actions tab
If you prefer manual deployment or need to deploy immediately:
- Install flyctl CLI and authenticate:
flyctl auth login- Connect to your existing app:
flyctl config save -a orc4bikes- Deploy your changes:
flyctl deployFor complete deployment instructions including:
- First-time setup
- Environment variables configuration
- Web interface management
- Generating new bicycle QR codes
- Troubleshooting
See FLYIO_SETUP.md for detailed deployment guide.
The bot requires these key environment variables:
TELE_API_TOKEN- Your Telegram bot tokenDB_ACCESS_KEY&DB_SECRET_KEY- AWS DynamoDB credentialsADMIN_GROUP_ID- Admin group chat IDADMIN_LIST- Comma-separated admin usernames
For the complete list, see .env.example and FLYIO_SETUP.md.