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:
parent
8f447fe5eb
commit
7843bd3f72
2 changed files with 13 additions and 3 deletions
|
|
@ -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`);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue