Getting Started
Player Lifecycle
End-to-end player flow, search, queue, play, pause, skip, seek and destroy.
This page documents the practical playback lifecycle used by real commands. Use it as the baseline sequence for play, queue control and teardown logic.
Type reference: Core API (TypeDoc)
Quick links:
Create or Reuse
import type { } from 'hoshimi';
declare const : ;
declare const : string;
declare const : string;
declare const : string;
const = .({
,
,
,
: 100,
: true,
});Search and Play
import { } from 'hoshimi';
import type { } from 'hoshimi';
declare const : ;
const = await .({
: 'Never Gonna Give You Up',
: {
: '123',
: 'demo-user',
},
});
if (. === . || . === .) {
const = .[0];
await ..();
if (!.()) {
await .();
}
}Runtime Controls
import { } from 'hoshimi';
import type { } from 'hoshimi';
declare const : ;
await .(true);
await .(false);
await .(30_000);
await .({ : 1 });
await .(150);
.(.);Disconnect vs Destroy
import { } from 'hoshimi';
import type { } from 'hoshimi';
declare const : ;
await .();
await .(.);State Gotchas
player.connectedmeans voice connection state, not playback.player.playingandplayer.pausedare not the same signal.player.positionis computed state; useseek()to move position.