Recipes

Send a Manual Voice Update

Push a voice-server payload to Lavalink yourself to force a reconnect or apply a rotation.

Hoshimi normally builds the voice payload from Discord gateway events for you. When you need to send one manually — to force a voice reconnect, or to apply a rotated token/endpoint without waiting for a gateway event — use the raw player update.

The player update body

player.updatePlayer(data) sends a raw PATCH /sessions/{sessionId}/players/{guildId} body. The voice field lives inside playerOptions, alongside track, volume, paused, position, endTime and filters.

manual-voice-update.ts
await .({
  : true,
  : {
    : { , , ,  },
  },
});

Resend the current connection

To force a reconnect you rarely have a fresh triplet — you just want to resend what the player already holds. player.voice.toNode() serializes the stored voice state, returning null when it is incomplete.

force-voice-reconnect.ts
const  = ..();
if () {
  await .({ : true, : {  } });
}

This does not touch Discord

A manual voice update only tells Lavalink about the voice server. It does not move or reconnect the bot on Discord's side — for that use player.setVoice(), player.voice.connect() or player.voice.move().