Next Generation V4 Release

The Most Advanced Lavalink Client for Discord.js

Featuring HTTP/2 support, smart node switching, real-time lyrics, SponsorBlock integration, dynamic EQ, A-B loop, playback speed control, and 70% performance improvements. Built for the next generation of Discord bots.

70%
Less RAM Usage
3x
Faster API Calls
95%
Faster Node Failover
500%
More Features
npm install euralink

Next Generation Features

Euralink V4 introduces revolutionary features that set new standards for Discord music bots with HTTP/2, smart switching, and advanced audio processing

SponsorBlock Integration

Automatically skip sponsor segments, intros, outros, and unwanted content with customizable categories and real-time detection.

Real-time Detection 7+ Categories Manual Override
player.setSponsorBlockCategories(['sponsor', 'intro']);

YouTube Chapters

Navigate through video chapters automatically with rich metadata, timestamps, and seamless chapter transitions.

Auto Detection Rich Metadata Navigation
const chapters = await player.getChapters();

Synced Lyrics

Display synchronized lyrics with precise timing, automatic track detection, and multiple provider support.

Real-time Sync Auto Detection Multi Provider
const lyrics = await player.getLyrics();

Filter Presets

16+ professional audio presets including Nightcore, Vaporwave, Karaoke, BassBoost, and gaming-optimized filters.

16+ Presets One Command Gaming Optimized
await player.setPreset('nightcore');

Enhanced Error Recovery

Automatic player migration, intelligent retry mechanisms, and graceful degradation for maximum uptime.

Auto Migration Smart Retry Zero Downtime
eura.migratePlayer(guildId, newNode);

HTTP/2 & Smart Switching

3x faster API calls with HTTP/2, zero-downtime node failover, and intelligent load balancing for maximum performance.

3x Faster Zero Downtime Auto Failover
nodeSwitching: { enabled: true }

Dynamic EQ & Audio

Real-time equalizer, A-B loop, playback speed control, and advanced audio processing for professional sound quality.

Real-time EQ A-B Loop Speed Control
await player.setABLoop(30000, 120000);

Voice Resilience

Auto-rejoin on disconnection, stuck playback detection, and intelligent voice recovery for uninterrupted music.

Auto Rejoin Stuck Detection Smart Recovery
voiceResilience: { enabled: true }

Performance Optimized

70% less RAM usage, 3x faster API calls, 95% faster node failover, and next-track preloading for instant transitions.

70% Less RAM 3x Faster 95% Faster Failover
// Automatic optimization - no config needed!

Quick Start

Get up and running with Euralink V4 in minutes

1

Install

npm install euralink
2

Initialize

const { Euralink } = require('euralink');
const eura = new Euralink(client, nodes, options);
3

Play Music

const player = eura.createConnection(options);
const result = await eura.resolve({ query });
player.queue.add(result.tracks[0]);
player.play();

Advanced V4 Example

// V4 Advanced Features
const { Euralink } = require('euralink');

const eura = new Euralink(client, nodes, {
  send: (data) => {
    const guild = client.guilds.cache.get(data.d.guild_id);
    if (guild) guild.shard.send(data);
  },
  defaultSearchPlatform: 'ytmsearch',
  
  // V4 Performance Features
  enhancedPerformance: { enabled: true },
  nodeSwitching: { enabled: true },
  persistence: { enabled: true },
  metrics: { enabled: true },
  
  // V4 Voice & Activity
  euraSync: { enabled: true },
  activityStatus: { enabled: true },
  resume: { enabled: true }
});

// Enhanced event handling
eura.on('trackStart', async (player, track) => {
  // Enable SponsorBlock for YouTube
  if (track.info.sourceName === 'youtube') {
    await player.setSponsorBlockCategories(['sponsor', 'selfpromo']);
  }
  
  // Get synced lyrics
  const lyrics = await player.getLyrics();
  if (lyrics) console.log('🎤 Synced lyrics available!');
  
  // Apply gaming preset with dynamic EQ
  await player.filters.setPreset('gaming');
  await player.filters.setEqualizer([
    { band: 0, gain: 0.2 },  // 60Hz
    { band: 1, gain: 0.1 }   // 170Hz
  ]);
});

// V4 Smart Node Switching
eura.on('playerMigrated', (player, oldNode, newNode) => {
  console.log(`🔄 Migrated: ${oldNode.name} → ${newNode.name}`);
});

// V4 Voice Resilience
eura.on('playerDisconnect', (player) => {
  console.log('🔌 Auto-reconnecting...');
});

// V4 Performance Monitoring
eura.on('healthCheck', (health) => {
  console.log(`📊 Health: ${health.overall}`);
});

Interactive Examples

Explore real-world implementations of Euralink V4 features

SponsorBlock Implementation

// Complete SponsorBlock setup
client.on('messageCreate', async (message) => {
  if (message.content.startsWith('!play ')) {
    const query = message.content.slice(6);
    
    const player = eura.createConnection({
      guildId: message.guildId,
      voiceChannel: message.member.voice.channelId,
      textChannel: message.channelId
    });

    const result = await eura.resolve({ query, requester: message.author });
    player.queue.add(result.tracks[0]);
    
    // Enable comprehensive SponsorBlock
    await player.setSponsorBlockCategories([
      'sponsor',      // Paid promotions
      'selfpromo',    // Self promotion
      'interaction',  // Subscribe reminders
      'intro',        // Intro animations
      'outro',        // Outro/endscreens
      'preview',      // Video previews
      'music_offtopic' // Non-music sections
    ]);
    
    player.play();
    message.reply('đŸŽĩ Playing with SponsorBlock enabled!');
  }
});

// Listen for skipped segments
eura.on('sponsorSkipped', (player, segment) => {
  const channel = client.channels.cache.get(player.textChannel);
  channel?.send(`â­ī¸ Skipped ${segment.category} segment (${segment.duration}ms)`);
});

SponsorBlock Categories

sponsor Paid promotions and sponsorships
selfpromo Self-promotion and merchandise
interaction Subscribe/like reminders
intro Intro animations and sequences
outro Outro sequences and endscreens
preview Video previews and recaps
music_offtopic Non-music content in music videos

Synced Lyrics Integration

// Synced lyrics with real-time display
eura.on('trackStart', async (player, track) => {
  const lyrics = await player.getLyrics();
  
  if (lyrics && lyrics.lines.length > 0) {
    const channel = client.channels.cache.get(player.textChannel);
    channel?.send(`🎤 **Synced lyrics available for:** ${track.info.title}`);
    
    // Create lyrics display interval
    const lyricsInterval = setInterval(() => {
      const currentLine = player.getCurrentLyricLine();
      
      if (currentLine && currentLine.text.trim()) {
        console.log(`đŸŽĩ ${currentLine.text}`);
        
        // Send to Discord channel every 10 seconds
        if (Date.now() % 10000 < 1000) {
          channel?.send(`đŸŽĩ \`${currentLine.text}\``);
        }
      }
    }, 1000);
    
    // Clear interval when track ends
    player.once('trackEnd', () => {
      clearInterval(lyricsInterval);
    });
  }
});

// Manual lyrics command
client.on('messageCreate', async (message) => {
  if (message.content === '!lyrics') {
    const player = eura.players.get(message.guildId);
    
    if (player && player.current) {
      const currentLine = player.getCurrentLyricLine();
      
      if (currentLine) {
        message.reply(`đŸŽĩ **Current lyric:** ${currentLine.text}`);
      } else {
        message.reply('❌ No synced lyrics available for this track');
      }
    }
  }
});

Lyrics Features

Real-time Synchronization

Lyrics sync perfectly with track position

Auto Detection

Automatically detects and loads lyrics

Multiple Providers

Supports various lyrics providers

Precise Timing

Millisecond-accurate lyric timing

Filter Presets System

// Filter preset commands
client.on('messageCreate', async (message) => {
  if (message.content.startsWith('!preset ')) {
    const preset = message.content.split(' ')[1];
    const player = eura.players.get(message.guildId);
    
    if (!player) return message.reply('❌ No active player');
    
    try {
      // Apply preset with automatic filter clearing
      await player.setPreset(preset, { clearFilters: true });
      message.reply(`✅ Applied **${preset}** preset!`);
    } catch (error) {
      message.reply(`❌ Invalid preset. Available: ${availablePresets.join(', ')}`);
    }
  }
  
  if (message.content === '!presets') {
    const presetsList = availablePresets.map(preset => `\`${preset}\``).join(', ');
    message.reply(`đŸŽ›ī¸ **Available presets:** ${presetsList}`);
  }
  
  if (message.content === '!clear-filters') {
    const player = eura.players.get(message.guildId);
    if (player) {
      await player.clearFilters();
      message.reply('🔄 Cleared all audio filters');
    }
  }
});

const availablePresets = [
  'nightcore', 'vaporwave', 'bassboost', 'karaoke',
  'pop', 'rock', 'classical', 'electronic',
  'gaming-fps', 'gaming-moba', 'podcast', 'vocal-boost',
  'cinema', 'radio', 'studio', 'live'
];

Available Presets

Music Genres
nightcore vaporwave pop rock classical electronic
Audio Enhancement
bassboost vocal-boost karaoke studio cinema radio
Gaming Optimized
gaming-fps gaming-moba podcast live

Enhanced Error Recovery

// Automatic error recovery setup
const eura = new Euralink(client, nodes, {
  send: (data) => {
    const guild = client.guilds.cache.get(data.d.guild_id);
    if (guild) guild.shard.send(data);
  },
  autoResume: true,
  restVersion: 'v4',
  // Enhanced error recovery options
  retryLimit: 5,
  retryDelay: 1000,
  failoverTimeout: 30000
});

// Node error handling
eura.on('nodeError', async (node, error) => {
  console.log(`❌ Node ${node.name} error:`, error.message);
  
  // Perform health check
  const healthStatus = await eura.performHealthCheck();
  console.log('đŸĨ Health status:', healthStatus);
  
  // Migrate players if needed
  const players = [...eura.players.values()].filter(p => p.node === node);
  for (const player of players) {
    const bestNode = eura.getBestNode();
    if (bestNode && bestNode !== node) {
      await eura.migratePlayer(player.guildId, bestNode);
      console.log(`🔄 Migrated player ${player.guildId} to ${bestNode.name}`);
    }
  }
});

// Player error recovery
eura.on('playerError', async (player, error) => {
  console.log(`❌ Player error in ${player.guildId}:`, error.message);
  
  // Attempt automatic recovery
  try {
    if (player.current) {
      await player.restart();
      console.log(`🔄 Restarted player ${player.guildId}`);
    }
  } catch (recoveryError) {
    console.log(`❌ Recovery failed for ${player.guildId}`);
    // Implement fallback strategy
    player.stop();
  }
});

// Save/load player states for persistence
process.on('SIGINT', async () => {
  await eura.savePlayersState('./players.json');
  console.log('💾 Saved player states');
  process.exit(0);
});

client.on('ready', async () => {
  eura.init(client.user.id);
  
  try {
    const loadedCount = await eura.loadPlayersState('./players.json');
    console.log(`📂 Loaded ${loadedCount} player states`);
  } catch (error) {
    console.log('â„šī¸ No saved states found');
  }
});

Recovery Features

Auto Migration

Seamlessly migrate players between nodes

Smart Retry

Intelligent retry with exponential backoff

Health Monitoring

Real-time node health tracking

State Persistence

Save and restore player states

Smart Node Switching

// V4 Smart Node Switching
const eura = new Euralink(client, nodes, {
  nodeSwitching: {
    enabled: true,
    healthCheckInterval: 30000,
    migrationThreshold: 0.7
  }
});

// Listen to migration events
eura.on('playerMigrated', (player, oldNode, newNode) => {
  console.log(`🔄 Player migrated: ${oldNode.name} → ${newNode.name}`);
  // Music continues seamlessly!
});

// Manual node switching
eura.on('messageCreate', async (message) => {
  if (message.content === '!switch') {
    const player = eura.get(message.guildId);
    if (player) {
      const bestNode = eura.getBestNode();
      if (bestNode && bestNode !== player.node) {
        await eura.migratePlayer(message.guildId, bestNode);
        message.reply(`🔄 Switched to ${bestNode.name}`);
      }
    }
  }
});

// Health monitoring
setInterval(async () => {
  const health = await eura.getSystemHealth();
  if (health.overall !== 'healthy') {
    console.log('🚨 System health degraded:', health);
  }
}, 60000);

Smart Switching Features

Zero Downtime

Seamless switching without interruption

Load Balancing

Intelligent distribution across nodes

Health Monitoring

Real-time node performance tracking

Auto Migration

Automatic failover on node issues

Dynamic Audio Processing

// V4 Dynamic Audio Features
eura.on('messageCreate', async (message) => {
  const player = eura.get(message.guildId);
  if (!player) return;
  
  if (message.content.startsWith('!eq ')) {
    const bands = message.content.slice(4).split(' ').map(Number);
    await player.filters.setEqualizer([
      { band: 0, gain: bands[0] || 0 },  // 60Hz
      { band: 1, gain: bands[1] || 0 },  // 170Hz
      { band: 2, gain: bands[2] || 0 },  // 310Hz
      { band: 3, gain: bands[3] || 0 },  // 600Hz
      { band: 4, gain: bands[4] || 0 }   // 1kHz
    ]);
    message.reply('đŸŽšī¸ EQ updated!');
  }
  
  if (message.content.startsWith('!loop ')) {
    const [start, end] = message.content.slice(6).split(' ').map(Number);
    await player.setABLoop(start * 1000, end * 1000);
    message.reply(`â¯ī¸ A-B loop set: ${start}s - ${end}s`);
  }
  
  if (message.content.startsWith('!speed ')) {
    const speed = parseFloat(message.content.slice(7));
    if (speed >= 0.5 && speed <= 2.0) {
      await player.setPlaybackSpeed(speed);
      message.reply(`đŸŽšī¸ Speed set to ${speed}x`);
    }
  }
  
  if (message.content.startsWith('!seek ')) {
    const percent = parseInt(message.content.slice(6));
    if (percent >= 0 && percent <= 100) {
      await player.seekPercentage(percent);
      message.reply(`📊 Seeked to ${percent}%`);
    }
  }
});

// Apply gaming preset with custom EQ
eura.on('trackStart', async (player, track) => {
  await player.filters.setPreset('gaming');
  await player.filters.setEqualizer([
    { band: 0, gain: 0.3 },  // Boost bass
    { band: 1, gain: 0.2 },  // Boost low-mid
    { band: 2, gain: 0.0 },  // Neutral mid
    { band: 3, gain: 0.1 },  // Slight high-mid boost
    { band: 4, gain: 0.2 }   // Boost treble
  ]);
});

Dynamic Audio Features

Real-time EQ

Live equalizer adjustments

A-B Loop

Loop specific track sections

Speed Control

0.5x to 2.0x playback speed

Seek by %

Jump to specific positions

Changelog

Track the evolution of Euralink with detailed release notes

V4.0 - Next Generation Release

Current

🚀 Revolutionary Features

  • HTTP/2 Support: 3x faster API calls with connection pooling and multiplexing
  • Smart Node Switching: Zero-downtime failover with intelligent load balancing
  • Voice Resilience: Auto-rejoin on disconnection with stuck playback detection
  • Dynamic EQ: Real-time equalizer with multiple bands and live adjustments
  • A-B Loop: Loop specific sections of tracks with precise timing
  • Playback Speed Control: Adjust speed from 0.5x to 2.0x in real-time
  • Seek by Percentage: Jump to specific positions with percentage-based seeking
  • Player State Persistence: Auto-save/load exact playback state across restarts

⚡ Performance Improvements

  • 70% less RAM usage with advanced memory optimization
  • 3x faster API calls with HTTP/2 and connection pooling
  • 95% faster node failover with zero-downtime switching
  • 80% fewer API requests with intelligent batching and caching
  • Next-track preloading for instant transitions
  • Smart shuffle avoiding recently played tracks
  • 10x faster queue operations with optimized algorithms

🔧 Developer Experience

  • 1000+ lines of TypeScript definitions with full IntelliSense
  • Prometheus metrics integration for real-time monitoring
  • Structured JSON logging with configurable levels
  • Plugin system with lifecycle hooks and extensibility
  • 100% backward compatibility with all previous versions
  • Comprehensive health monitoring and diagnostics

🐛 Bug Fixes

  • Fixed version check warnings in development environments
  • Improved health check logic for localhost and development nodes
  • Enhanced error handling in filter operations and preset applications
  • Resolved lyrics synchronization timing accuracy issues
  • Fixed memory leaks in large queue operations and batch processing

V0.2.0-beta.1 - Major Update

Previous

✨ New Features

  • Complete AutoResume system with position restoration
  • HTTP2 support with persistent agents
  • Advanced health monitoring and load balancing
  • Enhanced queue management with statistics
  • EuraSync voice status updates
  • Plugin system foundation

V0.1.5-beta.1 - Initial Release

Legacy

🎉 Initial Features

  • Basic Lavalink client functionality
  • Track loading and playback support
  • Queue management system
  • Voice connection handling