Monitor scene releases in real-time and get instant Discord notifications for your favorite content!
PreWatch is a Discord bot that monitors scene releases from the PreDB in real-time. Subscribe to search queries and get instant notifications when matching releases are found, built with discordx and discord.js v14.
|
Subscribe to search queries and get notified when matching scene releases appear. |
Live connection for instant release notifications as they happen. |
|
Fuzzy matching algorithm optimized for scene releases with similarity detection. |
Keyv with SQLite backend for persistent subscription storage without SQL complexity. |
|
Beautiful Discord Components for all interactions with buttons and styled messages. |
Choose between DM or channel notifications with one-click unsubscribe buttons. |
- Bun v1.4.0 - Fast JavaScript runtime tested in CI
- Discord Bot Application with bot token
- Access to Predb.ovh API (default endpoint)
-
Download the latest release (click on 'Source code (zip)').
-
Extract and move the files to your desired location.
-
Install Bun:
- Mac/Linux:
curl -fsSL https://bun.sh/install | bash - Windows:
powershell -c "irm bun.sh/install.ps1 | iex"
- Mac/Linux:
-
Navigate to your project folder:
cd /path/to/your/extracted/source -
Rename
.env.exampleto.envand configure your settings:- Required: Bot token, API URL, notification channel/mode
- Bot Token Guide
- Channel ID Guide
-
Install dependencies:
bun install
-
Start the bot:
bun start
/add <query>- Subscribe to a search query for release notifications/list- View and manage your active subscriptions/setalertschannel- Choose this server's release alerts channel (Manage Server permission)/help- Display all available commands/ping- Check bot status and performance
The release stream reconnects automatically after connection failures, including when the API is unavailable during startup. HTTP requests and WebSocket handshakes have a 15-second timeout.
Set POLLING_ENABLED=true to recover releases missed during an outage. Polling is disabled by default. POLLING_INTERVAL_SECONDS controls the base interval, and requests are paced at 30 per minute per cluster. Catch-up reads all pages back to the recovery boundary before advancing its cursor; incomplete requests and failed notifications are retried. A five-minute overlap accounts for delayed API indexing.
Delivery receipts are stored for seven days so distinct releases with the same timestamp and out-of-order live events can be delivered independently. Subscription updates are serialized per guild and restored after a failed storage mutation. Storage recovery still depends on the database remaining available.
Similar-query confirmations expire after 15 minutes. Notification unsubscribe buttons use compact query identifiers and continue to work across query case variants.
Run the same checks used in CI:
bun install --frozen-lockfile
bun run lint
bun run test
bun run auditTests use mocked Discord and API connections, temporary SQLite databases, and a local HTTP proxy. They do not log in to Discord or contact PreDB.
Security overrides select patched tar and @tootallnate/once versions. Compatibility tests cover SQLite archive extraction, node-gyp's streaming extraction API, and HTTP proxy requests.
The transitive braces v3.0.3 dependency has no upstream fix for GHSA-vfj7-8cjw-p6xm. The committed Bun patch rejects nesting at a depth of 128 in parsing, compilation, expansion, and stringification, including caller-provided ASTs. Regression tests verify the mitigation. bun run audit excludes only this locally patched advisory because registry scanners still identify the original package version. Retire the patch and exception when an upstream fixed version becomes available.
|
Adding Subscriptions |
Release Notifications |
|
Subscription Management |
Similarity Detection Smart detection prevents duplicate subscriptions |
We welcome contributions to improve PreWatch! If you'd like to contribute:
- Fork the repository
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them with a clear, descriptive message:
git commit -m 'Add feature: brief description of your changes' - Push your changes to your fork:
git push origin feature/your-feature-name
- Open a Pull Request against the main repository's
mainbranch
Please ensure your code follows the existing patterns and include clear descriptions in your Pull Request. Focus on performance and user experience improvements.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details. (It's mostly "Share the love, and keep it open!")
- PredDB for the awesome scene release tracking
- discord.js for the powerful Discord API wrapper
- discordx for the decorator-based command framework
- Bun for the blazing fast JavaScript runtime
- Keyv for simple key-value storage
Got questions or need help? Join our Discord server for support and to connect with other PreWatch users!
๐ป Crafted with โค๏ธ by Valhalla-Development Built on the ValkyrieCore Discord bot template.
๐ Spotted an issue? | ๐ก Got an idea? | ๐ค Need help?