A self-hosted, legally-clean music bot library for discord.js.
Code. Create. Conquer. — Brought to you by Omnikon
Most Discord music bots scrape YouTube audio, violating YouTube's Terms of Service. This gets bots DMCA'd, IP-blocked, or banned completely. Existing alternatives are either abandoned or rely on fragile scraper libraries like ytdl-core.
Auris solves this by providing a robust, legal-only audio pipeline. Built from the ground up without YouTube scraping, this library guarantees peace of mind while delivering a high-quality, feature-rich audio experience for your users.
- 🎵 Legally Safe Audio Sources: Native support for safe, authorized streaming.
- Local Files: Play MP3, OGG, WAV, and FLAC directly from your server.
- Direct URLs: Stream from any directly hosted audio file.
- Jamendo API: Access thousands of royalty-free / Creative Commons tracks.
- SoundCloud API: Stream officially permitted tracks from SoundCloud.
- 🔌 BYO Adapter System: Easily integrate your own licensed catalog or corporate library using our simple 2-method interface.
- 🔁 Robust Playback Engine: Complete queue management with Loop (Track/Queue), Skip, Pause/Resume, and granular Volume control.
- ⚙️ Smart Voice Management: Automatically reconnects on network drops and gracefully disconnects when inactive or alone.
- ⚡ Modern Architecture: Written in strict TypeScript, exporting both ESM and CommonJS for seamless integration in any Node environment.
- Node.js: v18.0.0 or higher.
- FFmpeg: Required for audio processing.
- Ubuntu/Debian:
sudo apt install ffmpeg - MacOS:
brew install ffmpeg - Windows: Download from ffmpeg.org and add to PATH.
- Ubuntu/Debian:
npm install @omnikon/auris discord.js @discordjs/voice libsodium-wrappersIntegrate music into your existing discord.js bot instantly:
import { Client, GatewayIntentBits } from 'discord.js';
import { Player, LocalFileAdapter } from '@omnikon/auris';
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates] });
const player = new Player();
const localAdapter = new LocalFileAdapter();
player.registerAdapter(localAdapter);
// Inside your command execution block:
await player.connect(interaction.member.voice.channel);
const track = await localAdapter.getTrack('./assets/music/track.mp3');
await player.play(track);| Adapter | Description | Setup |
|---|---|---|
| LocalFileAdapter | Plays audio from your local filesystem. | new LocalFileAdapter() |
| DirectUrlAdapter | Streams audio directly from an HTTP URL. | new DirectUrlAdapter() |
| JamendoAdapter | Searches and streams from Jamendo API. | new JamendoAdapter('YOUR_CLIENT_ID') |
| SoundCloudAdapter | Streams permitted tracks from SoundCloud. | new SoundCloudAdapter('YOUR_CLIENT_ID') |
The core queue and playback manager.
connect(channel: VoiceBasedChannel): Joins the voice channel and prepares playback.disconnect(): Gracefully leaves the voice channel and flushes the queue.play(track: Track | Track[]): Appends track(s) to the queue and starts playing if idle.pause()/resume(): Toggles playback state.skip(): Skips the currently playing track.stop(): Halts playback entirely and clears the queue.
setVolume(level: number): Adjusts the volume between0and200.setLoopMode(mode: LoopMode): Sets looping behavior.LoopMode.OFFLoopMode.TRACKLoopMode.QUEUE
getQueue(): Track[]: Returns the pending tracks.getCurrentTrack(): Track | null: Returns the active track.
The Player emits standard events you can hook into for logging or sending Discord embeds:
player.on('trackStart', (track) => console.log(`Now playing: ${track.title}`));
player.on('trackEnd', (track) => console.log(`Finished: ${track.title}`));
player.on('queueEnd', () => console.log(`Queue empty!`));We've provided a fully functioning Discord bot showcasing all slash commands (/play, /pause, /skip, /loop, /queue, /volume).
- Clone the repository.
- Run
npm install. - Copy
examples/bot/.env.exampletoexamples/bot/.envand add your Discord Bot Token. - Start the bot:
npm run dev:example
- Invite the bot to your server and type
/playin any channel!
Part of the Omnikon Ecosystem
schema-cast • PackVault • IssueSwipe • Abyss