Incredible bot with its own voice/audio engine, scalable architecture, multiple filters and support for 6 music platforms.
English | Π ΡΡΡΠΊΠΈΠΉ
- π€
SNIPPIK
π’ Report any bugs or omissions to Issues or Discord
Important
SNIPPIK
Please respect the authorship and license of the project.
Tip
I recommend enabling the caching system in .env. This will allow you to play tracks even if the platform is completely blocked.
However, the voice system is simply not allowed to lose audio packets, even under critical load!
Warning
If you use a proxy, keep in mind that FFmpeg does not support socks. For such tasks, there's STH
- Total load for
1 layer + shard(Voice + Player) - CPU:
~0.1% - RAM:
80 MB
Schedulerfor 1 thread (50 UDP + RingBuffer) ~0.1% CPUOggOpusParserfor 1 conversion cycle ~0.5 CPU (1.2 sec)
- The most complex operations are handled by Rust via n-api, providing almost complete independence from Node.js limitations.
- You can define the decoder mode (
voip,audio,lowdelay), enable/disableVBR, enable/disable packet loss during the download phase, and also enableFEC. - There are strict delay limits to limit audio corruption, which can also be changed!
Click to open
- The core voice processing logic is moved to a native Rust module (src-rs), ensuring stability even with high event loop lag in Node.js.
- Voice Engine: Full implementation of Voice Gateway V8. Stack: UDP + SRTP + Opus.
- Security: Support for End-to-End Encryption (E2EE π) via the Discord DAVE protocol.
- Timers: Cyclic systems using a timer + auto-balancing.
- Smart Streaming: No external Opus encoders required for streamingβit uses a proprietary Opus frame parsing method.
- FFmpeg Integration: Used for flexible audio decoding and complex filtering.
- Support for YouTube, Spotify, VK, Yandex-Music, SoundCloud, Deezer, and Apple (only a draft).
- Smart Fallback: If a track is unavailable on one platform, the system will automatically find it on another.
- Related Tracks: Automatically selects and plays similar tracks for endless listening.
- Worker Threads: All heavy-duty search and parsing operations are moved to separate worker threads to avoid blocking the bot's main thread. - Extensibility: Modular architecture via Dynamic Handler allows you to add a new platform in minutes.
- Languages: Full support for Russian and English (language file).
- DX (Developer Experience): The entire project is strongly typed (TypeScript + Rust ABI), comes with a bunch of interfaces and examples.
- Scalability: Easily add any languages ββsupported by Discord.
Even if the main Node.js thread is hard blocked, audio continues playing without lag or distortion.
Click to open
// π£ Event Loop Blocking Test (x4)
setInterval(() => {
const start = performance.now();
while (performance.now() - start < 100) {}
}, 100);- Everything depends on the limitations of Discord itself. There are no encoding restrictions; you can try feeding Discord even 512 KBit audio.
- Hot Audio Swap: Instant seamless transitions between tracks.
- Audio Effects: Smooth fade-in/fade-out for any actions (skip, seek, pause)
- Filters: 16+ built-in audio filters with the ability to easily add your own via the JSON config (filters.json)
- Sync: Direct synchronization of the audio stream without distortion introduced by software filters.
Warning
Losses on the client side are impossible, if a loss occurs accidentally you will see it in the current track message
If your internet is unstable, losses will occur in any case.
It is impossible to completely eliminate packet lost due to the UDP protocol and other discord limitations.
Click to open
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. REQUEST INITIATION β
β /play command β Platform API (YouTube, SoundCloud, Yandex...) β Fetch URL/ID β
β (REST Layer) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. RESOURCE RESOLUTION (ResourceProvider) β
β β’ AudioCache check (if already downloaded β instant return of .opus file path) β
β β’ If not: db.api.fetchAudioLink() β obtain temporary URL from platform β
β β’ HTTPS client (with Keep-Alive and redirects) β HEAD / GET stream β
β β’ If needed: save stream to AudioCache (background worker) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. DECODING AND PARSING β
β [Rust] FFmpegProcess / native OggOpusParser (if source is already Opus) β
β β’ Chunked reading (streaming) β
β β’ Extraction of raw Opus frames (OggParser::parse_internal) β
β β’ Stripping Ogg container β pure Opus bytes for each frame β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. PLAYER PREPARATION (AudioPlayer) β
β β’ Track queue (Queue) β Track β AudioResource β
β β’ If filters enabled (nightcore, bassboost) β applied ON Opus without PCM β
β β’ Hot Audio Swap: instant source switching without breaking the connection β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 5. TRANSMISSION SCHEDULER (CycleManager + Balancer) β
β [Rust] tokio runtime β
β β’ Balancer groups up to 50 active connections per cycle β
β β’ CycleManager runs a loop with ~20 ms interval β
β β’ Each cycle pulls ready Opus frames from AudioPlayer β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 6. TRANSPORT LAYERS (Layers) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β RTPLayer β β
β β β’ Adds RTP header (SSRC, timestamp, sequence number) β β
β β β’ Encrypts RTP packet with DAVELayer key (or static secret_key) β β
β β β’ Forms final UDP datagram ready for sending β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β DAVELayer (if channel is E2EE) β β β
β β β β’ Obtains keys from MLS session β β β
β β β β’ Encrypts Opus frame (AES-GCM) β β β
β β β β’ Fallback: up to 3 retries on encryption failure β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β β β
β β βΌ β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β β UDPLayer β β β
β β β β’ Sends packet via UDP socket to Discord Voice Server β β β
β β β β’ Discovery Handshake (performed once per connection) β β β
β β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 7. RECEPTION AND STATISTICS β
β β’ Discord receives RTP packets, decodes Opus, plays back in the voice channel β
β β’ WatKLOK collects WebRTC feedback: Delay, Packet Loss β
β β’ Logging of all stages with [RAM] and timestamps β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ- Interactive buttons: actions depend on the player's state
- Progress bar support with timecodes
- Responsive UI - no need to reuse commands
Click to open
| Command | Autocomplete | Arguments | Description |
|---|---|---|---|
/filter |
β | (off, push, disable) | Audio filters |
/play |
β | (query) | Playback |
/player |
β | (api, replay, stop, related) | Advanced playback |
/volume |
β | value | Player Volume |
/remove |
β | value | Delete Track |
/seek |
β | 00:00, int | Rewind Track |
/skip |
β | (back, to, next) | Skip Tracks |
/repeat |
β | type | Repeat Type |
/queue |
β | {destroy, list} | Queue Management |
/voice |
β | (join, leave, tribune) | Voice Channel |
- Node.js, FFmpeg, and Rust (optional) required
- You don't need to build Rust components! Ready-made builds here
All parameters should already be defined in
.env.custom, so take it and rename it to .env
# Clone
git clone https://github.com/SNIPPIK/UnTitles
cd UnTitles
# Install dependencies
npm i
# If you need to build Rust components
# If you don't want to build, download the ready-made build and add everything to build/native
npm run build:native
# Build Typescript + run
npm run build && npm run start- In case you're curious about how the bot is built
