Skip to content

Commit 243ac33

Browse files
committed
docs: audit markdown documentation and add apps/bot README
1 parent 7e4a0b8 commit 243ac33

4 files changed

Lines changed: 92 additions & 2 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TWITCH_CLIENT_SECRET=""
3838

3939
# Other APIs
4040
KLIPY_API="" # API key for anime reactions and interactive GIFs
41-
NEWS_API="" # NewsAPI key for /news headline searches
41+
NEWS_API="" # NewsAPI key for /world-news global headline searches
4242
GENIUS_API="" # Genius API client token for /lyrics song lyrics lookup
4343

4444
# Feature Flags (Enable or disable specific bot modules dynamically)

apps/bot/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# 🤖 Master-Bot Discord Application (`@master-bot/bot`)
2+
3+
The Discord client application for **Master-Bot**, built with [Sapphire Framework](https://www.sapphirejs.dev/), [discord.js v14](https://discord.js.org/), [Lavalink v4 (`lavalink-client`)](https://github.com/lavalink-devs/Lavalink), and [Prisma ORM](https://www.prisma.io/).
4+
5+
---
6+
7+
## 🏗️ Architecture & Directory Structure
8+
9+
```text
10+
apps/bot/
11+
├── src/
12+
│ ├── commands/ # 74 Sapphire chat input (slash) commands
13+
│ │ ├── gifs/ # Klipy & Waifu.im reaction commands
14+
│ │ ├── moderation/ # Ban, kick, purge, slowmode, timeout
15+
│ │ ├── music/ # Lavalink audio playback & playlist suite
16+
│ │ ├── other/ # Utilities, games, polls, reminders, news
17+
│ │ └── twitch/ # Twitch status monitor
18+
│ ├── lib/ # Internal business logic and class modules
19+
│ │ ├── games/ # Connect 4, Tic-Tac-Toe, Rock-Paper-Scissors
20+
│ │ ├── gifs/ # Media scrapers & fetchers
21+
│ │ ├── music/ # Queue, Track, Lavalink node managers, NowPlaying embeds
22+
│ │ ├── presence/ # Dynamic rotating presence status manager
23+
│ │ ├── reminders/ # Background reminder cron scheduler
24+
│ │ ├── structures/ # ExtendedClient and CommandHelp interfaces
25+
│ │ └── twitch/ # Twitch token and live stream checkers
26+
│ ├── listeners/ # Sapphire event listeners
27+
│ │ ├── guild/ # Guild member add/remove, role updates, channel events
28+
│ │ ├── interaction/ # Slash commands, autocomplete, and error handlers
29+
│ │ ├── music/ # Lavalink node connection and track lifecycle events
30+
│ │ └── tempchannels/ # Temporary voice channel lifecycle management
31+
│ ├── preconditions/ # Sapphire preconditions (isCommandDisabled, permissions)
32+
│ └── env.ts # Type-safe environment validation
33+
├── package.json
34+
└── tsconfig.json
35+
```
36+
37+
---
38+
39+
## ⚡ Key Features & Subsystems
40+
41+
1. **🎵 Lavalink v4 Audio Playback**:
42+
- YouTube multi-client failover with automated OAuth device token capture.
43+
- Spotify metadata resolution via `lavasrc-plugin`.
44+
- Free built-in SoundCloud track search and playback.
45+
- Interactive channel now-playing embeds with live 5-second ASCII progress bars.
46+
- Audio DSP filters: Bassboost, Karaoke, Nightcore, Vaporwave.
47+
2. **🔨 Moderation Suite**:
48+
- Slash commands with hierarchy safety checks and automated audit logging.
49+
3. **🎫 Support Tickets**:
50+
- Thread-based ticketing system with interactive buttons (`ticket_create`, `ticket_close`) and `.txt` transcript archiving.
51+
4. **⏰ Scheduled Reminders**:
52+
- In-memory background scheduler checking database reminders every 30 seconds.
53+
5. **📜 Audit Logging**:
54+
- 18 granular server event listeners routing formatted embeds to designated log channels.
55+
56+
---
57+
58+
## 🚀 Running & Building
59+
60+
From the workspace root:
61+
62+
```bash
63+
# Build the bot TypeScript application
64+
pnpm --filter @master-bot/bot build
65+
66+
# Launch the bot in development watch mode
67+
pnpm --filter @master-bot/bot dev
68+
69+
# Launch full development stack (Bot + Dashboard + Lavalink)
70+
pnpm dev
71+
```

wiki/API-Keys.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,26 @@ Master-Bot integrates with multiple external services. Below is a complete guide
4848
- **Variable:** `KLIPY_API`
4949
- **Features:** Powers `/gif` search commands.
5050

51+
### NewsAPI (Global News Headlines & Search)
52+
- **Portal:** [NewsAPI.org](https://newsapi.org/) (Register for free API Key)
53+
- **Variable:** `NEWS_API`
54+
- **Features:** Powers the `/world-news` slash command. Provides top global headlines by country (`us`, `gb`, `ca`, `au`, `de`, `fr`, `in`, `jp`), topic categories (Technology, Business, Science, Health, Sports, Entertainment), or keyword searches with rich embed previews, article thumbnails, relative timestamps, and direct links.
55+
5156
### Genius API (Song Lyrics)
5257
- **Portal:** [Genius API Clients](https://genius.com/api-clients/new)
5358
- **Variable:** `GENIUS_API`
5459
- **Features:** Song lyrics fetching (`/lyrics`).
60+
61+
---
62+
63+
## 🚩 Dynamic Feature Flags
64+
65+
Master-Bot allows enabling or disabling entire bot subsystems dynamically via environment variables without code modification:
66+
67+
| Variable | Default | Description |
68+
| :--- | :--- | :--- |
69+
| `LAVA_ENABLED` | `false` | Master toggle for Lavalink audio engine and all music playback commands |
70+
| `GIFS_ENABLED` | `true` | Enables animated GIF reactions and media commands (`/gif`, `/hug`, `/waifu`, etc.) |
71+
| `TWITCH_ENABLED` | `true` | Enables Twitch streamer monitoring and live notification alerts |
72+
| `NEWS_ENABLED` | `true` | Enables global news headlines via NewsAPI (`/world-news`) |
73+
| `IGDB_ENABLED` | `true` | Enables video game search via IGDB (`/game-search`) |

wiki/Home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- **[Setup & Deployment Guide](Setup-and-Deployment.md)**: Step-by-step local development setup, unified launcher instructions (`pnpm dev` / `pnpm start`), and Docker Compose deployment.
1010
- **[Heroku Deployment Guide](Heroku-Deployment.md)**: Production cloud hosting on Heroku (Buildpacks, Docker containers, PostgreSQL & Redis add-ons, dyno scaling).
1111
- **[Lavalink v4 Audio Engine](Lavalink.md)**: In-depth Lavalink v4 configuration, plugin management (`youtube-plugin`, `lavasrc-plugin`), remote signature deciphering, and automatic YouTube OAuth device authorization.
12-
- **[API Keys & Credentials](API-Keys.md)**: Guide on acquiring and setting up required and optional credentials (Discord, Twitch, Klipy, IGDB, YouTube).
12+
- **[API Keys & Credentials](API-Keys.md)**: Guide on acquiring and setting up required and optional credentials (Discord, Twitch, Klipy, IGDB, NewsAPI, YouTube).
1313
- **[Commands Reference](Commands-Reference.md)**: Full reference for all available slash commands, interactive help browser, and parameters.
1414

1515
---

0 commit comments

Comments
 (0)