Refactor to apps/ structure
JIGAIDO is now a platform with apps/ as the container. All telegram-bot files moved to apps/telegram-bot/: - bot.py, commands.py, cron.py, db.py, schema.sql - requirements.txt, .env.example, README.md - Root now holds SPEC.md, README.md, CONTRIBUTING.md only. Structure: jigaido/ ├── apps/ │ └── telegram-bot/ └── SPEC.md, README.md, CONTRIBUTING.md
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -9,9 +9,6 @@ __pycache__/
|
|||||||
venv/
|
venv/
|
||||||
env/
|
env/
|
||||||
|
|
||||||
# Database
|
|
||||||
*.db
|
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
|
|||||||
65
README.md
65
README.md
@@ -2,9 +2,13 @@
|
|||||||
|
|
||||||
> Named after Nanami Kento's Cursed Technique restriction. Suppresses power during normal hours, exerts it during overtime.
|
> Named after Nanami Kento's Cursed Technique restriction. Suppresses power during normal hours, exerts it during overtime.
|
||||||
|
|
||||||
A lightweight bounty tracker for Telegram groups and individuals. Track obligations, deadlines, and tasks with optional reminders.
|
A bounty tracking platform. Currently ships with a Telegram bot for managing and tracking bounties in groups and DMs.
|
||||||
|
|
||||||
## Features
|
## Apps
|
||||||
|
|
||||||
|
- **[Telegram Bot](./apps/telegram-bot/)** — Group and personal bounty tracking via Telegram commands, with due date reminders
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
- **Group bounties**: Each Telegram group has its own bounty list
|
- **Group bounties**: Each Telegram group has its own bounty list
|
||||||
- **Personal bounties**: Private DM bounty list for individuals
|
- **Personal bounties**: Private DM bounty list for individuals
|
||||||
@@ -13,60 +17,19 @@ A lightweight bounty tracker for Telegram groups and individuals. Track obligati
|
|||||||
- **Due date reminders**: Daily cron notifies users when bounties are due within 7 days
|
- **Due date reminders**: Daily cron notifies users when bounties are due within 7 days
|
||||||
- **Free-form dates**: Natural language due dates (`"tomorrow"`, `"in 3 days"`, `"april 15"`)
|
- **Free-form dates**: Natural language due dates (`"tomorrow"`, `"in 3 days"`, `"april 15"`)
|
||||||
- **Link deduplication**: No duplicate links within the same group
|
- **Link deduplication**: No duplicate links within the same group
|
||||||
- **Zero infrastructure**: SQLite + Python, deploys on any $5 VPS
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Install dependencies
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# Set bot token
|
|
||||||
export JIGAIDO_BOT_TOKEN="your:token_here"
|
|
||||||
|
|
||||||
# Initialize database and start bot
|
|
||||||
python bot.py
|
|
||||||
```
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
| Command | Where | Who | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| `/bounty` | Group / DM | Anyone | List all bounties |
|
|
||||||
| `/my` | Group / DM | Anyone | List your tracked bounties |
|
|
||||||
| `/add <text> [link] [due]` | Group | Admin | Add bounty |
|
|
||||||
| `/add <text> [link] [due]` | DM | Anyone | Add personal bounty |
|
|
||||||
| `/update <id> [text] [link] [due]` | Group | Admin | Update bounty |
|
|
||||||
| `/delete <id>` | Group | Admin | Delete bounty |
|
|
||||||
| `/track <id>` | Group / DM | Anyone | Track a bounty |
|
|
||||||
| `/untrack <id>` | Group / DM | Anyone | Stop tracking |
|
|
||||||
| `/admin_add <user>` | Group | Creator | Promote to admin |
|
|
||||||
| `/admin_remove <user>` | Group | Creator | Demote admin |
|
|
||||||
| `/start` | Group / DM | Anyone | Re-initialize |
|
|
||||||
| `/help` | Anywhere | Anyone | Show help |
|
|
||||||
|
|
||||||
## Reminders
|
|
||||||
|
|
||||||
Schedule a daily cron job:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# crontab -e
|
|
||||||
0 9 * * * cd /path/to/jigaido && JIGAIDO_BOT_TOKEN="your:token" python -m cron
|
|
||||||
```
|
|
||||||
|
|
||||||
Or via systemd timer (see `cron.py`).
|
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
jigaido/
|
jigaido/
|
||||||
├── bot.py # Telegram bot entrypoint
|
├── apps/
|
||||||
├── db.py # SQLite database wrapper
|
│ └── telegram-bot/ ← first app (Python)
|
||||||
├── schema.sql # Database schema
|
│ ├── bot.py
|
||||||
├── cron.py # Daily reminder job
|
│ ├── commands.py
|
||||||
├── commands.py # Command handlers
|
│ ├── cron.py
|
||||||
├── requirements.txt
|
│ ├── db.py
|
||||||
└── SPEC.md # Full specification
|
│ └── requirements.txt
|
||||||
|
└── SPEC.md ← full design specification
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
17
SPEC.md
17
SPEC.md
@@ -31,14 +31,17 @@ JIGAIDO is a Telegram bot that lets groups and individuals track bounties — ta
|
|||||||
|
|
||||||
```
|
```
|
||||||
jigaido/
|
jigaido/
|
||||||
├── bot.py # Telegram bot entrypoint, command handlers
|
├── apps/
|
||||||
├── db.py # SQLite wrapper
|
│ └── telegram-bot/ # Telegram bot app
|
||||||
├── schema.sql # Database schema
|
│ ├── bot.py # Entrypoint
|
||||||
├── cron.py # Daily reminder job
|
│ ├── commands.py # Command handlers
|
||||||
├── requirements.txt
|
│ ├── cron.py # Daily reminder job
|
||||||
├── .gitignore
|
│ ├── db.py # SQLite wrapper
|
||||||
├── README.md
|
│ ├── schema.sql # Database schema
|
||||||
|
│ ├── requirements.txt
|
||||||
|
│ └── .env.example
|
||||||
├── SPEC.md # This document
|
├── SPEC.md # This document
|
||||||
|
├── README.md
|
||||||
└── CONTRIBUTING.md
|
└── CONTRIBUTING.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
2
apps/telegram-bot/.env.example
Normal file
2
apps/telegram-bot/.env.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Telegram Bot Token (get from @BotFather)
|
||||||
|
JIGAIDO_BOT_TOKEN=
|
||||||
44
apps/telegram-bot/README.md
Normal file
44
apps/telegram-bot/README.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Telegram Bot
|
||||||
|
|
||||||
|
A Telegram bot for managing and tracking bounties in groups and DMs.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd apps/telegram-bot
|
||||||
|
cp .env.example .env
|
||||||
|
# Edit .env and add your bot token
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python bot.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Reminders
|
||||||
|
|
||||||
|
Schedule a daily cron job:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# crontab -e
|
||||||
|
0 9 * * * cd /path/to/jigaido/apps/telegram-bot && JIGAIDO_BOT_TOKEN="..." python cron.py
|
||||||
|
```
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
| Command | Where | Who | Description |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `/bounty` | Group / DM | Anyone | List all bounties |
|
||||||
|
| `/my` | Group / DM | Anyone | List your tracked bounties |
|
||||||
|
| `/add <text> [link] [due>` | Group | Admin | Add bounty |
|
||||||
|
| `/add <text> [link] [due>` | DM | Anyone | Add personal bounty |
|
||||||
|
| `/update <id> [text] [link] [due>` | Group | Admin | Update bounty |
|
||||||
|
| `/delete <id>` | Group | Admin | Delete bounty |
|
||||||
|
| `/track <id>` | Group / DM | Anyone | Track a bounty |
|
||||||
|
| `/untrack <id>` | Group / DM | Anyone | Stop tracking |
|
||||||
|
| `/admin_add <user>` | Group | Creator | Promote to admin |
|
||||||
|
| `/admin_remove <user>` | Group | Creator | Demote admin |
|
||||||
|
| `/start` | Group / DM | Anyone | Re-initialize |
|
||||||
|
| `/help` | Anywhere | Anyone | Show help |
|
||||||
0
apps/telegram-bot/__init__.py
Normal file
0
apps/telegram-bot/__init__.py
Normal file
Reference in New Issue
Block a user