Skip to content

Latest commit

 

History

History
311 lines (244 loc) · 8 KB

File metadata and controls

311 lines (244 loc) · 8 KB

🔄 Euralink V0.3.0 - Backward Compatibility Guide

100% Backward Compatible

Euralink V0.3.0 maintains full backward compatibility with all previous versions. Your existing code will continue to work without any changes!


📋 Legacy Options Still Supported

🔧 All Old Configuration Options Work

// ✅ OLD WAY (V0.2.x) - Still works perfectly!
const eura = new Euralink(client, nodes, {
    send: (data) => { /* your send function */ },
    restVersion: 'v4',
    defaultSearchPlatform: 'ytmsearch',
    
    // Legacy node options - ALL STILL WORK
    dynamicSwitching: true,
    autoReconnect: true,
    reconnectTries: 5,
    reconnectInterval: 5000,
    
    // Legacy resume options - ALL STILL WORK  
    autoResume: true,
    resumeKey: 'my-resume-key',
    resumeTimeout: 60000,
    
    // Legacy sync options - ALL STILL WORK
    eurasync: { enabled: true, template: '🎵 {title}' },
    setActivityStatus: { enabled: true, template: '🎵 {title}' },
    
    // Other legacy options - ALL STILL WORK
    autopauseOnEmpty: true,
    lazyLoad: { enabled: true },
    plugins: [/* your plugins */],
    retryCount: 3,
    timeout: 5000,
    debug: false
});

🆕 NEW WAY (V0.3.0) - Enhanced & Organized

// 🚀 NEW WAY (V0.3.0) - More organized and powerful
const eura = new Euralink(client, nodes, {
    send: (data) => { /* your send function */ },
    defaultSearchPlatform: 'ytmsearch',
    
    // Enhanced REST configuration
    rest: {
        version: 'v4',
        retryCount: 3,
        timeout: 5000
    },
    
    // Enhanced node configuration
    node: {
        dynamicSwitching: true,
        autoReconnect: true,
        ws: {
            reconnectTries: 5,
            reconnectInterval: 5000
        }
    },
    
    // Enhanced resume configuration
    resume: {
        enabled: true,
        key: 'my-resume-key',
        timeout: 60000
    },
    
    // Enhanced sync configuration
    euraSync: {
        enabled: true,
        template: '🎵 {title} by {author}'
    },
    
    // Enhanced activity status
    activityStatus: {
        enabled: true,
        template: '🎵 {title} by {author}'
    },
    
    // NEW: Enhanced performance options
    enhancedPerformance: {
        enabled: true,
        connectionPooling: true,
        requestBatching: true,
        memoryOptimization: true
    },
    
    // Other options
    autopauseOnEmpty: true,
    lazyLoad: { enabled: true, timeout: 5000 },
    plugins: [/* your plugins */],
    track: { historyLimit: 50 }
});

🔗 Option Mapping

REST Configuration

Legacy Option New Location Status
restVersion rest.version ✅ Both work
retryCount rest.retryCount ✅ Both work
timeout rest.timeout ✅ Both work

Node Configuration

Legacy Option New Location Status
dynamicSwitching node.dynamicSwitching ✅ Both work
autoReconnect node.autoReconnect ✅ Both work
reconnectTries node.ws.reconnectTries ✅ Both work
reconnectInterval node.ws.reconnectInterval ✅ Both work

Resume Configuration

Legacy Option New Location Status
autoResume resume.enabled ✅ Both work
resumeKey resume.key ✅ Both work
resumeTimeout resume.timeout ✅ Both work

Sync & Activity Configuration

Legacy Option New Location Status
eurasync euraSync ✅ Both work
setActivityStatus activityStatus ✅ Both work
sync euraSync ✅ Both work

🔥 Migration Examples

Example 1: Basic Bot (No Changes Needed)

// Your existing V0.2.x code - WORKS AS-IS in V0.3.0!
const eura = new Euralink(client, nodes, {
    send: (data) => {
        const guild = client.guilds.cache.get(data.d.guild_id);
        if (guild) guild.shard.send(data);
    },
    restVersion: 'v4',
    defaultSearchPlatform: 'ytmsearch',
    autoResume: true,
    autopauseOnEmpty: true
});

// ✅ This code works perfectly in V0.3.0!

Example 2: Advanced Bot (Optional Migration)

// OLD (V0.2.x) - Still works!
const eura = new Euralink(client, nodes, {
    send: sendFunction,
    restVersion: 'v4',
    dynamicSwitching: true,
    autoReconnect: true,
    reconnectTries: 3,
    autoResume: true,
    resumeKey: 'my-bot-resume',
    eurasync: { enabled: true, template: '🎵 {title}' }
});

// NEW (V0.3.0) - Enhanced version (optional)
const eura = new Euralink(client, nodes, {
    send: sendFunction,
    rest: { version: 'v4' },
    node: {
        dynamicSwitching: true,
        autoReconnect: true,
        ws: { reconnectTries: 3 }
    },
    resume: {
        enabled: true,
        key: 'my-bot-resume'
    },
    euraSync: {
        enabled: true,
        template: '🎵 {title} by {author}'
    },
    // NEW: Take advantage of new features
    enhancedPerformance: { enabled: true }
});

🆕 New Features (Optional)

You can gradually adopt new V0.3.0 features without breaking existing functionality:

1. SponsorBlock (NEW)

// Add SponsorBlock to existing bot
const player = eura.get(guildId);
await player.setSponsorBlockCategories(['sponsor', 'selfpromo']);

2. Filter Presets (NEW)

// Apply audio presets to existing bot
await player.filters.setPreset('gaming');
await player.filters.setPreset('party');

3. Enhanced Error Recovery (NEW)

// Enhanced error handling (automatic)
eura.on('playerMigrated', (player, oldNode, newNode) => {
    console.log(`Player migrated: ${oldNode.name}${newNode.name}`);
});

4. Health Monitoring (NEW)

// System health monitoring
const health = await eura.performHealthCheck();
console.log(`System status: ${health.overall}`);

⚠️ Deprecation Warnings

While all old options still work, we recommend migrating to the new structured format for future updates:

// ⚠️ Deprecated (but still works)
autoResume: true

// ✅ Recommended
resume: { enabled: true }

🔍 Testing Your Existing Code

  1. Install V0.3.0:

    npm install euralink@0.3.0
  2. Run your existing bot - it should work without any changes!

  3. Check for any warnings in the console (optional improvements)

  4. Gradually adopt new features when you're ready


🤝 Migration Strategy

Phase 1: Zero-Risk Upgrade

  • ✅ Install V0.3.0
  • ✅ Keep all existing code
  • ✅ Enjoy automatic performance improvements

Phase 2: Gradual Enhancement (Optional)

  • 🔄 Restructure config to new format
  • 🆕 Add SponsorBlock support
  • 🎛️ Use filter presets
  • 📊 Add health monitoring

Phase 3: Full V0.3.0 Experience (Optional)

  • 🚀 Enable enhanced performance features
  • 📖 Add chapter support
  • 🛡️ Implement advanced error handling
  • 📈 Monitor system health

💡 Tips for Migration

  1. Start Small: Upgrade to V0.3.0 first, then add new features gradually
  2. Test Thoroughly: Test your bot in a development environment first
  3. Monitor Performance: Check the automatic performance improvements
  4. Join Discord: Get help in our Discord server

📞 Need Help?


Summary

Euralink V0.3.0 is 100% backward compatible!

  • ✅ All your existing code works without changes
  • ✅ All legacy options are still supported
  • ✅ Automatic performance improvements
  • ✅ Optional new features when you're ready
  • ✅ Smooth migration path

Upgrade today and enjoy the best lavalink client experience! 🎵