From 7843bd3f7263c11cd5f3e210591b0ae3b777cc9d Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Sat, 13 Dec 2025 08:41:14 +0000 Subject: [PATCH] Improve music playback stability by adjusting connection settings Update music command and bot configuration to include Shoukaku options, textId/voiceId, and shardId for more reliable voice connections. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 3fdb9ba3-be2d-454d-a6cb-1448d76639c9 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/RxaoyQl Replit-Helium-Checkpoint-Created: true --- aethex-bot/bot.js | 11 ++++++++++- aethex-bot/commands/music.js | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/aethex-bot/bot.js b/aethex-bot/bot.js index 4ebba2f..998686b 100644 --- a/aethex-bot/bot.js +++ b/aethex-bot/bot.js @@ -74,13 +74,22 @@ const LavalinkNodes = [ } ]; +const shoukakuOptions = { + moveOnDisconnect: false, + resumable: true, + resumableTimeout: 60, + reconnectTries: 5, + restTimeout: 30000, + reconnectInterval: 5 +}; + const kazagumo = new Kazagumo({ defaultSearchEngine: 'youtube', send: (guildId, payload) => { const guild = client.guilds.cache.get(guildId); if (guild) guild.shard.send(payload); } -}, new Connectors.DiscordJS(client), LavalinkNodes); +}, new Connectors.DiscordJS(client), LavalinkNodes, shoukakuOptions); kazagumo.shoukaku.on('ready', (name) => { console.log(`[Music] Lavalink node "${name}" connected`); diff --git a/aethex-bot/commands/music.js b/aethex-bot/commands/music.js index 729de3c..e900dce 100644 --- a/aethex-bot/commands/music.js +++ b/aethex-bot/commands/music.js @@ -98,8 +98,9 @@ module.exports = { if (!player) { player = await kazagumo.createPlayer({ guildId: interaction.guildId, - textChannel: interaction.channelId, - voiceChannel: memberVoice.id, + textId: interaction.channelId, + voiceId: memberVoice.id, + shardId: interaction.guild.shardId || 0, volume: 50, deaf: true });