Revolutionary Virtual Digital Assistant (RVDiA) is a high-performance, Indonesian-oriented entertainment companion, utility bot, and RPG platform built entirely on a modern Python stack.
- 🔮 Discord Bot: Codenamed RVDiA Genryu (源流 - "The Origin/Source"). It acts as the primary coordinator, managing AI interactions, local GPU generation routing, voice clients, and cogs.
- ⚡ Telegram Bot: Codenamed RVDiA Zora (空 - "Sky"). It serves as a lightweight, database-synced multi-play client running concurrently within the main event loop.
- Core Features
- Codebase Directory Structure
- Database Schema & Architecture
- Local GPU Generation Pipeline
- Web Dashboard & REST APIs
- Embeddable Web Chat Widget
- Local Development Setup
- Deployment
- Credits & Contributors
- Tactical In-Battle Interface: Features paginated Select Menus (complying with Discord's UI limits) for skills and equipments, complete with real-time health trackers and active state monitoring.
- Shop & Inventory: Over 100+ items, skills, and equipments configured in JSON and dynamically translated based on locale settings.
- Boss Fights & Elite Tiers: Challenging bosses with complex phases (e.g., Demi-fiend, Nahobino) and unique mechanisms.
- Collectible Title Nameplates: Unique achievements unlocked via boss battles or passive triggers, displayed as custom glowing/rainbow badges on high-resolution player profile cards.
- Daily Multipliers & Streaks: Consecutive daily logins build a multiplier bonus (up to +50% rewards). Integrated with Top.gg vote checks to double daily rewards (EXP, Coins, Karma).
- Co-op World Boss Battles: Face off against community-wide World Bosses with real-time HP synchronization. Recruit dreamers directly from status screens to send reinforcements calls.
- Mathematical Comparison: Employs OpenCV and Matplotlib to analyze and graph visual histograms side-by-side. Supports multiple metric engines (
correl,chisqr,intersect,bhattacharyya). - Complex Filtering: Grayscale, color inversion, circular cropping, blurring, sharpening, Edge detection (Canny, Sobel, Laplacian), noise insertion, histogram equalization (CLAHE), embossing, sepia, pixelation, vignette, gamma correction, Fourier domain filters (LPF, HPF, homomorphic), steganography (LSB hide/reveal), and wavelet decomposition.
- Paginated Navigation: Built-in interactive Discord UI button components enabling fast Next/Prev searching for internet images directly inside message threads.
- Contextual Recall: Integrates Google Gemini API with Prisma Client Python and vector embeddings to search, record, and write persistent user interactions.
- Linguistic Title Casing: Intelligent formatter processing title-casing rules tailored specifically for Indonesian and English grammatical structures.
- Gateway E2EE DAVE Support: Upgraded to
discord.py[voice]>=2.7.1with the mandatory DAVE (Discord Audio/Video End-to-End Encryption) protocol. - SoundCloud Fast Search: Bypasses metadata processing during initial queries using flat extraction (
process=False), rendering query dropdowns instantly (~0.5s instead of ~10.7s). - Lazy Stream Resolution: Resolves the streaming media URL on-demand right before the track is played in the voice channel.
- Advanced Player Controls: Integrated
seek,forward,rewind, queue shuffling, loop modes (Off, Repeat One, Repeat All), Spotify track resolution, and surprise genre command (surprise). - Auto-Disconnect & Idle Cleanups: Automatically leaves the channel if the bot is left alone with only bots for more than 1 minute, or if the queue is empty for over 5 minutes.
RVDiA/
├── cogs/ # Discord Bot Commands and Cogs
│ ├── Conversation.py # Google GenAI Chat & Vector Memories
│ ├── Image.py # OpenCV / CuPy Filters & Steganography
│ ├── Music.py # Music Player (SoundCloud + Fast Search)
│ ├── Game.py # Turn-based RPG Battle Engine
│ └── Verification.py # Verification and Server Gateways
├── docs/ # Documentation & Reference Files
│ ├── lore/ # RVDiA Lore Bible (AI context)
│ ├── game_manual.md # In-game guide & manual reference
│ ├── DISCOVERY.md # Bot listing SEO & promotional copy
│ └── image_eval.md # Image processing evaluation notes
├── locales/ # Multilingual Dictionaries (en.json / id.json)
├── scripts/ # Parallel Adapters and Backend Logic
│ ├── api/ # Web Server, OAuth2, REST APIs & Webhooks
│ │ ├── web_server.py # aiohttp Dashboard Entrypoint
│ │ ├── routes.py # Dashboard API Endpoints
│ │ ├── saweria_webhook.py # Saweria Auto-Premium Webhook
│ │ └── kofi_webhook.py # Ko-fi Auto-Premium Webhook
│ ├── ai/ # GPU Server pipelines & Memory managers
│ ├── telegram_bot.py # Telegram Polling Adapter (Zora)
│ └── main.py # Shared database (Prisma) connection
├── website/ # Static Assets & Web Templates
│ ├── static/ # CSS styling, local widget JS, images
│ └── templates/ # Jinja2 HTML Layouts (Dashboard, Widget)
├── schema.prisma # PostgreSQL Database Prisma Schema
├── Dockerfile # Production Slim Image Builder
└── RVDIA.py # Main Entrypoint / Bot Bootstrapper
RVDiA relies on PostgreSQL for persistence, mapped via schema.prisma. The core models are organized as follows:
erDiagram
User ||--o| Inventory : "owns"
User ||--o| Guild : "member of"
User ||--o| UserSettings : "customizes"
User ||--o{ Message : "sends"
User ||--o{ Memory : "associates"
User {
BigInt id PK
Int hp
Int max_hp
Json data "Level, EXP, Coins, Karma, Stats, Titles, Active_title"
DateTime premiumUntil
}
Guild {
Int id PK
String name
String tagline
String iconUrl
BigInt ownerId
}
Inventory {
Int id PK
BigInt userId FK
Json items "IDs & quantities"
Json skills "learned skills"
Json equipments "equipped items"
}
UserSettings {
BigInt userId PK
String lang "en/id"
}
- Relations Cascading: Disbanding a guild safely disconnects all user relations in the database. Deleting users cleanly cascade-deletes their related
Inventoryrecord.
To perform heavy Stable Diffusion inference (Meina/MeinaMix_V11) without exhausting memory on a low-VRAM development machine (RTX 3050 4GB), RVDiA offloads rendering to a localized laptop server. The process is gated by interactive Windows notification checks to prevent background disruptions:
sequenceDiagram
actor User as Discord User
participant Bot as RVDiA Bot (Railway)
participant Server as GPU Server (Local Laptop)
actor Owner as Laptop Owner (Schryzon)
User->>Bot: Slash Command /generate [prompt]
Bot->>Server: GET /ping (X-API-Key)
alt Server Offline
Bot-->>User: Reply: "Artist Offline"
else Server Online
Bot->>Server: POST /generate [prompt, username, is_nsfw]
Note over Server: Check NSFW blacklist (if SFW channel)
alt NSFW Blocked
Server-->>Bot: 400 Bad Request (NSFW Blocked)
Bot-->>User: Reply: "NSFW content blocked!"
else Allowed
Server-->>Bot: 200 OK (request_id)
Bot->>User: Defer response (loading...)
Server->>Owner: Winotify / Tkinter gated approval prompt
alt Owner Declines
Owner->>Server: Click "Decline"
Server->>Server: Update status: declined
else Owner Approves
Owner->>Server: Click "Approve"
Server->>Server: Update status: generating
Note over Server: Load SD model & Move CPU -> CUDA GPU
Server->>Server: Generate Image (512x512 PNG)
Note over Server: Move CUDA -> CPU & Aggressive VRAM Clear
Server->>Server: Save image & Update status: completed
end
loop Poll Status (Every 2s, max 15m)
Bot->>Server: GET /status/[request_id]
Server-->>Bot: Status (pending/generating/declined/completed)
end
alt Status: Completed
Bot->>Server: GET /image/[request_id]
Server-->>Bot: Image File
Bot-->>User: Send generated image!
else Status: Declined
Bot-->>User: Reply: "Generation declined by artist."
else Status: Failed / Timeout
Bot-->>User: Reply: "Generation failed."
end
end
end
The web interface is hosted on aiohttp and Jinja2 with zero Node dependencies, utilizing standard CSS and clean Javascript logic.
Authentication utilizes a secure Discord OAuth2 authorization flow. Sessions are persisted client-side using HMAC-signed cookies to prevent hijacking.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/v1/user/profile |
Fetches authenticated user's profile metadata and currencies. | Yes |
| GET | /api/v1/user/inventory |
Fetches the user's item, skill, and equipment logs. | Yes |
| GET | /api/v1/stats |
System metrics (uptime, CPU/RAM, command executions). | No |
| POST | /api/v1/chat |
Send a prompt to the context-aware chat engine. | Yes |
| GET | /api/v1/shop |
Fetches the translated list of marketplace items, categorized. | Yes |
| POST | /api/v1/shop/buy |
Purchase a shop item (consumable, skill, equipment). | Yes |
| GET | /api/v1/leaderboard |
Fetches Top Players or Guilds ranked rankings. | Yes |
| GET | /api/v1/guild |
Fetches active guild stats, tagline, icon, and member list. | Yes |
| POST | /api/v1/guild/create |
Spawns a guild for 5,000 Coins. | Yes |
| POST | /api/v1/guild/edit |
Modifies the guild name, tagline, or icon URL. | Yes |
| POST | /api/v1/guild/kick |
Kicks a member (only available to the guild owner). | Yes |
| POST | /api/v1/guild/leave |
Leave/disband the guild. | Yes |
| POST | /api/v1/public/chat |
Session-hashed public endpoint for the web widget. | No |
RVDiA features an embeddable chat script allowing users to interface with the AI assistant from external web pages.
To avoid polluting the database with arbitrary guest entries, the public endpoint /api/v1/public/chat handles stateless traffic by mapping incoming client UUIDs:
- Client generates a random UUID on their first load and saves it to
localStorage. - The server hashes this string using SHA-256 and extracts the first 8 bytes.
- This creates a positive 63-bit signed integer representation which serves as a virtual Discord user ID context in PostgreSQL.
- Allows persistent, isolated chat threads per web visitor without requiring Discord login credentials.
Include this script tag inside your HTML body to launch the chatbot:
<script
src="http://localhost:8080/static/js/rvdia-widget.js"
data-api-url="http://localhost:8080"
data-lang="id"
defer>
</script>Creators can visit the built-in development sandbox at /widget-demo to inspect the embedded script, configure language settings, and view real-time API logs detailing requests, UUID-to-ID hashes, and response packages.
Follow these steps to set up and run RVDiA on a Windows machine.
- PowerShell 5.1+ (or modern PowerShell Core)
- Python 3.12 (Scoop package manager is recommended:
scoop install python312) - PostgreSQL database instance.
-
Clone the repository:
git clone https://github.com/Schryzon/RVDiA.git cd RVDiA
-
Configure Environment Variables: Copy
.env.exampleto.envand fill out your api credentials, discord developer credentials, and local postgres database link:copy .env.example .env
-
Install Requirements:
pip install -r requirements.txt -
Initialize Prisma Client: Generate database abstractions and sync models:
# Generate schema bindings prisma generate # Synchronize models to Postgres prisma db push --accept-data-loss
-
Launch the Engine: Run the main bot and web panel:
python RVDIA.py
The dashboard will be active at
http://localhost:8080.
RVDiA is configured for seamless deployment on Railway using the provided Dockerfile and railway.toml.
When launching in a production container, start.sh runs automatically, ensuring the prisma database models are pushed and client headers are rebuilt before spawning RVDIA.py.
- Concept Inspiration: Riverdia.
- Advisors & Core Testers: iMaze, Mouchi, Dez, Zenchew, Ismita, Pockii, Kyuu, Kazama, Bcntt, Nateflakes, nathawiguna, opensourze, Shiruto, Satya Yoga.
Made with ❤️ and dedication by Jayananda and contributors.
Rebirth: 30/04/2026
