Lavende is a high-performance native audio processing library designed specifically for Discord bots. It completely replaces traditional external JVM-based nodes by running a native Rust core directly inside your bot's process.
- Native Performance: Engineered entirely in Rust for a minimal memory footprint and blistering execution speed.
- Zero-IPC Latency: Executes directly inside your application without REST or WebSocket overhead.
- Embedded DSP Engine: Apply Nightcore, Vaporwave, Bassboost, Equalizers, and 3D Rotation effortlessly on the native audio stream.
- DAVE (E2EE): Full support for Discord's End-to-End Encryption protocol out of the box.
- Multi-Language Support: Fully functional and strictly typed wrappers for Node.js, Python, Golang, and Rust.
- Audio Sources: Built-in resolution for YouTube, SoundCloud, Spotify, Apple Music, and Deezer via internal C-bindings.
Depending on your language, install Lavende via your package manager:
Node.js:
$ npm install lavendePython:
$ pip install lavendeGolang:
$ go get github.com/debaucheryparty/lavendeRust:
$ cargo add lavendeLavende sits side-by-side with your Discord API wrapper (e.g., discord.js, discord.py, discordgo). You simply pipe raw voice socket events into the Lavende Manager so that the Rust core can establish the UDP connection.
Here is a quick Node.js initialization strategy:
const { Client, GatewayIntentBits } = require("discord.js");
const { LavendeManager } = require("lavende");
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates],
});
let manager = null;
client.once("ready", () => {
manager = new LavendeManager({
sendToShard: (guildId, payload) => {
client.guilds.cache.get(guildId)?.shard?.send(payload);
},
client: { id: client.user.id, username: client.user.username },
});
manager.init();
});
// Pass raw socket events to Lavende to establish the Voice connection
client.on("raw", (packet) => {
if (manager) manager.sendRawData(packet);
});
client.login("token");- Clone the repository:
git clone https://github.com/debaucheryparty/lavende.git
cd lavende-
Choose your preferred language from the
_examplesdirectory:- Rust
- JavaScript / TypeScript
- Go
- Python
-
Create a
.envfile and add your Discord bot token:
TOKEN=YOUR_BOT_TOKEN- Install dependencies and run the example for your chosen language.
cd _examples/node
npm install
node bot.jscd _examples/python
pip install -r requirements.txt
python main.pycd _examples/go
go mod tidy
go run .cd _examples/rust
cargo runFor detailed guides, API documentation, and architecture information, see the docs/ directory.
Extensive documentation detailing the Rust architecture, the LavendeManager, Player, and Filters can be found in our official documentation directory:
The best way to understand how to build a bot with Lavende is to analyze the official boilerplate examples:
