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
This commit is contained in:
sirpiglr 2025-12-13 08:41:14 +00:00
parent 8f447fe5eb
commit 7843bd3f72
2 changed files with 13 additions and 3 deletions

View file

@ -74,13 +74,22 @@ const LavalinkNodes = [
} }
]; ];
const shoukakuOptions = {
moveOnDisconnect: false,
resumable: true,
resumableTimeout: 60,
reconnectTries: 5,
restTimeout: 30000,
reconnectInterval: 5
};
const kazagumo = new Kazagumo({ const kazagumo = new Kazagumo({
defaultSearchEngine: 'youtube', defaultSearchEngine: 'youtube',
send: (guildId, payload) => { send: (guildId, payload) => {
const guild = client.guilds.cache.get(guildId); const guild = client.guilds.cache.get(guildId);
if (guild) guild.shard.send(payload); if (guild) guild.shard.send(payload);
} }
}, new Connectors.DiscordJS(client), LavalinkNodes); }, new Connectors.DiscordJS(client), LavalinkNodes, shoukakuOptions);
kazagumo.shoukaku.on('ready', (name) => { kazagumo.shoukaku.on('ready', (name) => {
console.log(`[Music] Lavalink node "${name}" connected`); console.log(`[Music] Lavalink node "${name}" connected`);

View file

@ -98,8 +98,9 @@ module.exports = {
if (!player) { if (!player) {
player = await kazagumo.createPlayer({ player = await kazagumo.createPlayer({
guildId: interaction.guildId, guildId: interaction.guildId,
textChannel: interaction.channelId, textId: interaction.channelId,
voiceChannel: memberVoice.id, voiceId: memberVoice.id,
shardId: interaction.guild.shardId || 0,
volume: 50, volume: 50,
deaf: true deaf: true
}); });