Discord Player

discord-player

Entry point discord-player in discord-player (TypeScript API).

You are reading the v8 docsDev
Entry pointTypeScriptdiscord-player

Classes

BaseExtractorMinimal v7 lifecycle and source API, adapted to the source operation registry.
CapabilityCancelledErrorCancellation requested by a modern capability handler.
ContextGeneric AsyncLocalStorage-backed context.
DiscordPlayerFamiliar OOP Player facade for guild queues and the Remedia client.
DiscordPlayerErrorBase error carrying a stable Discord Player error code.
ExtractorExecutionContextSmall legacy ownership adapter; all execution goes through player.plugins.
GuildNodeManagerCache and lifecycle manager for this Player's GuildQueue instances.
GuildQueueOOP manager for upcoming tracks, playback policy, history, and queue lifecycle.
GuildQueueHistoryPrevious-track history and navigation for a GuildQueue.
GuildQueuePlayerAudioFiltersQueue-owned named presets and raw FFmpeg filtergraphs, applied through Remedia. Changes do not replay tracks or replace the voice session. Preset availability and graph validation depend on the selected Remedia build. Custom preset registration is unsupported.
GuildQueuePlayerNodeRaw playback controls for one guild queue. It never schedules queue tracks.
IllegalHookInvocationErrorError thrown when a guild-scoped hook cannot resolve a Player or guild queue.
LyricsOptional lyrics facade over the Player's shared capability registry.
NoResultErrorError thrown when a navigation or lookup operation has no matching result.
PlayerContextPer-Player context provider that also scopes hook helpers to that Player instance.
PlaylistA playlist and its tracks, independent of any Discord client library.
PluginErrorFailure attributed to a source registration and lifecycle stage or operation.
PluginRegistryContext-owned capability registry. Removal aborts and drains calls before teardown.
QueueA bounded FIFO collection. A limit of zero or Infinity means unbounded.
QueueCapacityErrorError thrown when public queue insertion exceeds maxSize.
SearchResultFamiliar search result wrapper used by Player-level playback.
SerializationErrorError thrown when a serialization input cannot be encoded or decoded.
SourceUnavailableErrorError thrown when a Track has no source plugin able to produce a Remedia source.
StackA bounded LIFO collection. Zero and Infinity mean unbounded.
SyncedLyricsProviderSorted, demand-driven synchronized lyrics using Remedia's media timeline.
TrackA Discord-library-agnostic track model. Source resolution belongs to a source plugin.

Interfaces

DiscordPlayerEventsPlayer-level event argument tuples.
DiscordPlayerStatisticsAggregated counts across the queues owned by a Player.
ExecuteOptionsOptional dispatch targeting and cancellation.
ExtractorExecutionResultResult returned from compatibility bridge requests.
ExtractorSearchContextSearch context passed to legacy handle methods.
GatewayVoiceStateNormalized Discord Gateway member state, independent of any Discord library.
GuildQueueConnectOptionsOptions accepted by a queue connection, using Discord Player's familiar percentage volume.
GuildQueueEventsMapQueue lifecycle and native observation argument tuples.
GuildQueueOptionsInitialization defaults and policies for one guild queue.
GuildQueuePlaybackMetadataCustom metadata stored on a Remedia generation created by queue-managed playback.
GuildQueuePlayerNodeSessionCreateOptionsPlayback session configuration supplied when a queue node creates or connects its raw session. volume uses linear gain, from 0 through 2; queue APIs accept percentages instead.
GuildQueuePlayOptionsQueue-level playback options; queue playback still resolves the Track source before calling the raw node.
GuildQueuePlayResultResult of a queue-managed playback request.
GuildQueueTimelineLive controller for a guild queue's current playback.
HandlerOptionsHandler ordering metadata.
LegacyPlayerContextSource-related Player surface shared by actual Players and standalone hosts.
LegacyTimeDataDuration fields consumed by legacy raw-stream extractors.
LocalCapabilityInputsPublic operation inputs for synchronous local interception.
LyricsAtActive lyric with its source timestamp, compatible with v7 lookup results.
LyricsLineOne normalized synchronized lyric line.
LyricsRequestLookup input shared by local plugins and HTTP metadata transport.
LyricsResultProvider-neutral lyrics record; either representation may be absent.
OperationDeclaration merged operation contract.
OperationContextPer-invocation cancellation supplied to all handlers.
OperationMapExtensible source operation contracts. Augmented operations also need host definitions.
PlaybackBackendAdvanced local provider. The framework retains ownership of queues and session references.
PlaybackBackendCapabilitiesExplicit capabilities of a custom playback provider.
PlaybackBackendContextInitialization services supplied before the provider creates playback resources.
PlaybackSessionMinimal structural session consumed by queue orchestration, independent of concrete native classes.
PlayerChannelIdsExplicit identifiers accepted when no channel object is available.
PlayerChannelLikeStructural voice-channel shape supported without a discord.js dependency.
PlayerContextInputInput accepted by PlayerContext.provide().
PlayerContextValueValues exposed by a Player context scope.
PlayerNodeInitializationResultResult of Player-level orchestration.
PlayerPlayOptionsPlayer-level playback orchestration options.
PlayerProgressbarOptionsFormatting options for a text progress bar.
PlayerTimestampCurrent and total playback time with a percentage progress value.
PlaylistDataMetadata used to construct a Playlist.
PlaylistJSONJSON-compatible Playlist representation.
PlayRawResultResult returned by raw playback.
PluginContextSource setup context shared by embedded and standalone execution.
PluginDefinitionSource declaration reusable across Player instances.
PluginRegistrationRegistration descriptor produced by a factory.
PostProcessedResultResult accepted from a local encoded-stream hook.
QueueAdmissionQueue admission input. Returned tracks are validated before capacity checks and commit.
QueueCapabilityContextPortable queue identity; no mutable queue internals are exposed.
QueueSelectionSelection policy shared by ordinary playback and crossfade staging.
RemotePluginHostOptionsExisting standalone HTTP deployment. Authentication stays outside Track metadata.
SearchOptionsSource search and compatibility options.
SearchResultDataResolved Tracks and optional source playlist metadata returned by search.
SerializableStructural contract implemented by models that can produce a persistence payload.
SourceBridgeRequestFallback request excluding the original provider.
SourceMatchMatch result carries identity so metadata resolves through the same provider.
SourceQuerySearch request independent of Discord client libraries.
SourceRelatedRequestRelated-media request with optional local legacy history.
SourceStreamTransformEncoded local stream transformation payload.
SourceTrackRequestSource request for one Track.
StreamHooksOptional resource interception callbacks; queue overrides Player overrides global.
StreamResolutionOptionsPlayback resolution configuration selected after the Remedia session is connected.
TimelineDispatcherOptionsOptions controlling the queue timeline exposed by useTimeline.
TrackCandidateOne candidate occurrence, distinguished even when the Track repeats.
TrackDataPublic metadata and optional portable source identity.
TrackJSONJSON-compatible representation of a Track.

Enumerations

TrackSkipReasonReason supplied with the v7-compatible playerSkip queue event.

Functions

createContextCreate a generic AsyncLocalStorage context.
decodeDecode Base64 JSON without validating its entity shape. Decoded values must still pass through deserialize() before reconstruction.
definePluginDefine a reusable source plugin.
deserializeReconstruct a Track from a versioned Track payload.
encodeEncode a versioned serialized entity as Base64 JSON.
onAfterCreateStreamRegister a global local-byte callback; returns a removal function.
onBeforeCreateStreamRegister a global source override; returns an ownership-aware removal function.
onStreamExtractedRegister global descriptor interception; returns a removal function.
parseLyricsParse LRC once, including multiple timestamps and decimal-second fractions.
serializeSerialize any model that follows the structural Serializable contract. The returned value is checked at runtime so custom implementations cannot emit non-JSON data.
useContextRead the currently active value of a generic context.
useHistoryRead a guild queue history manager.
useMainPlayerRead the scoped Player, otherwise the first active registered Player.
useMetadataRead and write guild queue metadata.
usePlayerRead the raw playback node for a guild queue.
useQueueRead a guild queue.
useTimelineRead and control the current guild queue playback.
useVolumeRead and write guild queue volume.

Type aliases

AudioFilterNameAccepted preset names, including a lowercase alias for the legacy spatial preset.
AudioFilterPresetNameCanonical built-in audio filter preset names.
CapabilityDecisionAn explicit veto or replacement from a modern plugin. Undefined leaves the input unchanged.
ContextReceiverCallback executed inside an asynchronous context scope.
CrossfadeOptionsAutomatic PCM crossfading policy. Changes apply to newly created sessions only.
DiscordPlayerErrorCodeError code union for Discord Player errors.
DiscordPlayerNodeA configured Remedia node snapshot/config type used by Player.
DiscordPlayerOptionsOptions for a Discord Player instance and its Remedia client.
DispatchPolicyOperation dispatch behavior.
EncodableCompatibility alias for the supported serialized entity union.
ExtractorConstructorClass constructors only: instances and modern plugin descriptors are not accepted.
ExtractorInfoLegacy extractor result.
ExtractorResolvableLegacy identifier or owned instance.
ExtractorStreamableLegacy encoded source; format hints cannot restore the obsolete audio stack.
GuildQueueEventsUnion of familiar guild queue event names.
GuildQueueResolvableGuild ID or a structural guild-like object.
JSONPrimitiveJSON scalar value accepted by Discord Player persistence payloads.
JSONValueDeep JSON-compatible value accepted by the serialization contract.
LyricsCallbackLyric notification callback.
LyricsDataRead-only timestamp/text view, compatible with v7 lyric-map inspection.
MediaResourceMedia accepted by the public player orchestration API. Strings are dispatched to source plugins.
MetadataDispatchRead and write queue metadata.
NativeSessionObservationDiscriminated native session observation, including events rejected by queue correlation.
NextFunctionLegacy post-stream callback.
NodeResolvableA guild queue instance or any value that can resolve to one.
OnAfterCreateStreamHandlerLocal encoded-byte hook; unavailable when Remedia owns the bytes.
OnBeforeCreateStreamHandlerSource interception before normal provider resolution.
OnStreamExtractedHandlerDescriptor interception after provider resolution.
OperationHandlerA handler may decline only by returning undefined.
OperationInputTyped input selected by operation name.
OperationNameNames available to source plugins.
OperationOutputTyped handler result selected by operation name.
OperationResultDispatch result selected by the declared policy.
PlaybackBackendEventsShared session event schemas. Backends emit their real events with original generation metadata.
PlaybackSessionOptionsSession creation settings; node placement is specific to the default Remedia backend.
PlaybackSourceEncoded media descriptor accepted by the framework source pipeline.
PlayerChannelResolvableSupported channel argument for Player.play().
PlayerEventPlayer-level event name union.
PlayerNodeInitializerOptionsCompatibility name for the v7-style initializer options.
PlayerTriggeredReasonReason attached to the familiar playerTrigger event.
PluginFactoryFactory requires options only when the options type has required fields.
ProviderReferenceSerializable provider identity; never put credentials or live objects in this payload.
QueueEventObservationActual public queue event arguments, after the queue object, in their documented order.
QueueEventParamsEvent parameter tuple with the owning queue prepended.
QueueRepeatModeA supported queue repeat mode.
RawPlaybackTerminalEventRemedia event variants that can end a raw playback generation.
RawTrackDataLegacy raw construction fields; live engines and callbacks remain process-local.
SearchQueryTypeLegacy query hint, including provider-defined string values.
SerializedEntityA versioned, discriminated serialized entity.
SerializedEntityUnionVersioned persistence entities supported by Discord Player.
SerializedPlaylistVersion 1 persistence representation of a Playlist.
SerializedPlaylistDataPublic Playlist fields stored by the versioned persistence format.
SerializedTrackVersion 1 persistence representation of a Track.
SerializedTrackDataPublic Track fields stored by the versioned persistence format.
SetterFNFunctional metadata update.
SourceStreamSupported local source results. Readables and byte buffers require embedded Remedia.
TrackRequesterRequester identifier or a structural requester object.
TrackResolvableA track identifier accepted by queue navigation and mutation methods.
TrackSourceName or identifier for a Track's source integration.
VolumeDispatchRead and write queue volume, awaited because Remedia applies gain asynchronously.
VolumeSetterFNFunctional volume update.
WithMetadataLegacy metadata refinement for custom extractor helpers.

Variables

AudioFilter
AudioFilterPresetsFixed v7-compatible FFmpeg filtergraph presets. Native validation remains owned by Remedia.
DiscordPlayerErrorCodePublic error codes for Discord Player's application-level failures.
GuildQueueEventsFamiliar event names emitted by GuildQueue instances through player.events.
PlayerEventFamiliar Player-level event names.
QueryTypeLegacy symbolic query hints. Uppercase underscore keys map to their v7 camel-case string values. Source-specific routing stays in plugins; this object performs no network or URL classification.
QueueRepeatModeRepeat policy applied after a managed playback generation reaches a terminal event.
SERIALIZATION_SCHEMA_VERSIONCurrent Discord Player serialization schema version, independent of package versions.
SerializedTypeEntity discriminator values used in versioned persistence payloads.
UtilSmall metadata helpers; obsolete voice and transcoding helpers are intentionally unavailable.

Re-exports

PlayerFamiliar OOP Player facade for guild queues and the Remedia client.

On this page