From dd8abc227ba09d963315726fbc7c15940646b8d2 Mon Sep 17 00:00:00 2001 From: saulteafarmer Date: Wed, 14 May 2025 15:38:46 +0000 Subject: [PATCH] Update README.md --- README.md | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1846cd6..c5f53aa 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,32 @@ # Discord LNbits Bot -This bot allows users to purchase a **Discord role** using **Bitcoin Lightning payments** through LNbits. -Users request an invoice via a **slash command** (configurable), and the bot automatically assigns the role **once payment is confirmed**. +A full-stack Dockerized membership engine that lets users purchase Discord roles via Bitcoin Lightning (LNbits). It provides: + - A Discord bot that dynamically registers slash-commands per membership β€œplan” + - A Flask web UI (port 3000) for configuring your Discord/LNbits credentials and creating/editing membership plans + - A Postgres backend to persist plans, subscriptions, and payment logs + - Automated expiry logic (calendar-month, rolling-days, fixed-date) with scheduled role revocation --- ## πŸš€ Features -- βœ… Dynamic slash‐command name (configured via `command_name`) -- βœ… Generates a **Lightning invoice** via LNbits -- βœ… Listens on LNbits WebSocket for paid invoices -- βœ… Automatically assigns a **Discord role** on payment -- βœ… Posts confirmations directly in your designated channel +- πŸ”§ **One-click Docker Compose**: bot + web UI + database +- βœ… **Dynamic slash-commands** for each plan (no code changes needed) +- ⚑ **Lightning invoices** via LNbits REST API +- 🌐 **WebSocket listener** for incoming payments +- πŸ‘€ **Automatic role assignment** on payment +- ⏰ **Scheduled cleanup** of expired subscriptions +- πŸ“Š **Persistent audit log** in Postgres (raw JSON, timestamps, statuses) --- ## πŸ“‹ Requirements -- **Ubuntu 24.04** -- **Python 3.10+** - **A Discord Bot Token** (from the [Developer Portal](https://discord.com/developers/applications)) - **LNbits Wallet Invoice Key** - **A running LNbits instance** (e.g., [Sats.Love](https://sats.love/)) +- **Docker Engine (v20+)** +- **Docker Compose (v1.29+ or the built-in docker compose)** --- @@ -86,19 +91,25 @@ git clone https://code.rustysats.com/saulteafarmer/discord-lnbits-bot cd discord-lnbits-bot ``` -### 3. Create & Activate Virtual Environment +### 3. Copy & Edit .env ```bash -python3 -m venv venv -source venv/bin/activate +cp .env.example .env +nano .env ``` -### 4. Install Dependencies +### 4. Buld & run ```bash -pip install -r requirements.txt +docker-compose up -d --build ``` +### 5. Open the web UI + +Visit: http://localhost:3000 + - Configure your Discord Bot Token, Guild ID, LNbits URL, LNbits Invoice Key + - Define membership plans (command name, role ID, channel ID, price, expiry policy) + --- ## 3️⃣ Find Your Discord Guild ID & Role ID