discord-player
Entry point discord-player in discord-player (TypeScript API).
You are reading the v8 docsDev
Entry pointTypeScriptdiscord-player
Classes
| BaseExtractor | Minimal v7 lifecycle and source API, adapted to the source operation registry. |
| CapabilityCancelledError | Cancellation requested by a modern capability handler. |
| Context | Generic AsyncLocalStorage-backed context. |
| DiscordPlayer | Familiar OOP Player facade for guild queues and the Remedia client. |
| DiscordPlayerError | Base error carrying a stable Discord Player error code. |
| ExtractorExecutionContext | Small legacy ownership adapter; all execution goes through player.plugins. |
| GuildNodeManager | Cache and lifecycle manager for this Player's GuildQueue instances. |
| GuildQueue | OOP manager for upcoming tracks, playback policy, history, and queue lifecycle. |
| GuildQueueHistory | Previous-track history and navigation for a GuildQueue. |
| GuildQueuePlayerAudioFilters | Queue-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. |
| GuildQueuePlayerNode | Raw playback controls for one guild queue. It never schedules queue tracks. |
| IllegalHookInvocationError | Error thrown when a guild-scoped hook cannot resolve a Player or guild queue. |
| Lyrics | Optional lyrics facade over the Player's shared capability registry. |
| NoResultError | Error thrown when a navigation or lookup operation has no matching result. |
| PlayerContext | Per-Player context provider that also scopes hook helpers to that Player instance. |
| Playlist | A playlist and its tracks, independent of any Discord client library. |
| PluginError | Failure attributed to a source registration and lifecycle stage or operation. |
| PluginRegistry | Context-owned capability registry. Removal aborts and drains calls before teardown. |
| Queue | A bounded FIFO collection. A limit of zero or Infinity means unbounded. |
| QueueCapacityError | Error thrown when public queue insertion exceeds maxSize. |
| SearchResult | Familiar search result wrapper used by Player-level playback. |
| SerializationError | Error thrown when a serialization input cannot be encoded or decoded. |
| SourceUnavailableError | Error thrown when a Track has no source plugin able to produce a Remedia source. |
| Stack | A bounded LIFO collection. Zero and Infinity mean unbounded. |
| SyncedLyricsProvider | Sorted, demand-driven synchronized lyrics using Remedia's media timeline. |
| Track | A Discord-library-agnostic track model. Source resolution belongs to a source plugin. |
Interfaces
| DiscordPlayerEvents | Player-level event argument tuples. |
| DiscordPlayerStatistics | Aggregated counts across the queues owned by a Player. |
| ExecuteOptions | Optional dispatch targeting and cancellation. |
| ExtractorExecutionResult | Result returned from compatibility bridge requests. |
| ExtractorSearchContext | Search context passed to legacy handle methods. |
| GatewayVoiceState | Normalized Discord Gateway member state, independent of any Discord library. |
| GuildQueueConnectOptions | Options accepted by a queue connection, using Discord Player's familiar percentage volume. |
| GuildQueueEventsMap | Queue lifecycle and native observation argument tuples. |
| GuildQueueOptions | Initialization defaults and policies for one guild queue. |
| GuildQueuePlaybackMetadata | Custom metadata stored on a Remedia generation created by queue-managed playback. |
| GuildQueuePlayerNodeSessionCreateOptions | Playback 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. |
| GuildQueuePlayOptions | Queue-level playback options; queue playback still resolves the Track source before calling the raw node. |
| GuildQueuePlayResult | Result of a queue-managed playback request. |
| GuildQueueTimeline | Live controller for a guild queue's current playback. |
| HandlerOptions | Handler ordering metadata. |
| LegacyPlayerContext | Source-related Player surface shared by actual Players and standalone hosts. |
| LegacyTimeData | Duration fields consumed by legacy raw-stream extractors. |
| LocalCapabilityInputs | Public operation inputs for synchronous local interception. |
| LyricsAt | Active lyric with its source timestamp, compatible with v7 lookup results. |
| LyricsLine | One normalized synchronized lyric line. |
| LyricsRequest | Lookup input shared by local plugins and HTTP metadata transport. |
| LyricsResult | Provider-neutral lyrics record; either representation may be absent. |
| Operation | Declaration merged operation contract. |
| OperationContext | Per-invocation cancellation supplied to all handlers. |
| OperationMap | Extensible source operation contracts. Augmented operations also need host definitions. |
| PlaybackBackend | Advanced local provider. The framework retains ownership of queues and session references. |
| PlaybackBackendCapabilities | Explicit capabilities of a custom playback provider. |
| PlaybackBackendContext | Initialization services supplied before the provider creates playback resources. |
| PlaybackSession | Minimal structural session consumed by queue orchestration, independent of concrete native classes. |
| PlayerChannelIds | Explicit identifiers accepted when no channel object is available. |
| PlayerChannelLike | Structural voice-channel shape supported without a discord.js dependency. |
| PlayerContextInput | Input accepted by PlayerContext.provide(). |
| PlayerContextValue | Values exposed by a Player context scope. |
| PlayerNodeInitializationResult | Result of Player-level orchestration. |
| PlayerPlayOptions | Player-level playback orchestration options. |
| PlayerProgressbarOptions | Formatting options for a text progress bar. |
| PlayerTimestamp | Current and total playback time with a percentage progress value. |
| PlaylistData | Metadata used to construct a Playlist. |
| PlaylistJSON | JSON-compatible Playlist representation. |
| PlayRawResult | Result returned by raw playback. |
| PluginContext | Source setup context shared by embedded and standalone execution. |
| PluginDefinition | Source declaration reusable across Player instances. |
| PluginRegistration | Registration descriptor produced by a factory. |
| PostProcessedResult | Result accepted from a local encoded-stream hook. |
| QueueAdmission | Queue admission input. Returned tracks are validated before capacity checks and commit. |
| QueueCapabilityContext | Portable queue identity; no mutable queue internals are exposed. |
| QueueSelection | Selection policy shared by ordinary playback and crossfade staging. |
| RemotePluginHostOptions | Existing standalone HTTP deployment. Authentication stays outside Track metadata. |
| SearchOptions | Source search and compatibility options. |
| SearchResultData | Resolved Tracks and optional source playlist metadata returned by search. |
| Serializable | Structural contract implemented by models that can produce a persistence payload. |
| SourceBridgeRequest | Fallback request excluding the original provider. |
| SourceMatch | Match result carries identity so metadata resolves through the same provider. |
| SourceQuery | Search request independent of Discord client libraries. |
| SourceRelatedRequest | Related-media request with optional local legacy history. |
| SourceStreamTransform | Encoded local stream transformation payload. |
| SourceTrackRequest | Source request for one Track. |
| StreamHooks | Optional resource interception callbacks; queue overrides Player overrides global. |
| StreamResolutionOptions | Playback resolution configuration selected after the Remedia session is connected. |
| TimelineDispatcherOptions | Options controlling the queue timeline exposed by useTimeline. |
| TrackCandidate | One candidate occurrence, distinguished even when the Track repeats. |
| TrackData | Public metadata and optional portable source identity. |
| TrackJSON | JSON-compatible representation of a Track. |
Enumerations
| TrackSkipReason | Reason supplied with the v7-compatible playerSkip queue event. |
Functions
| createContext | Create a generic AsyncLocalStorage context. |
| decode | Decode Base64 JSON without validating its entity shape. Decoded values must still pass through deserialize() before reconstruction. |
| definePlugin | Define a reusable source plugin. |
| deserialize | Reconstruct a Track from a versioned Track payload. |
| encode | Encode a versioned serialized entity as Base64 JSON. |
| onAfterCreateStream | Register a global local-byte callback; returns a removal function. |
| onBeforeCreateStream | Register a global source override; returns an ownership-aware removal function. |
| onStreamExtracted | Register global descriptor interception; returns a removal function. |
| parseLyrics | Parse LRC once, including multiple timestamps and decimal-second fractions. |
| serialize | Serialize any model that follows the structural Serializable contract. The returned value is checked at runtime so custom implementations cannot emit non-JSON data. |
| useContext | Read the currently active value of a generic context. |
| useHistory | Read a guild queue history manager. |
| useMainPlayer | Read the scoped Player, otherwise the first active registered Player. |
| useMetadata | Read and write guild queue metadata. |
| usePlayer | Read the raw playback node for a guild queue. |
| useQueue | Read a guild queue. |
| useTimeline | Read and control the current guild queue playback. |
| useVolume | Read and write guild queue volume. |
Type aliases
| AudioFilterName | Accepted preset names, including a lowercase alias for the legacy spatial preset. |
| AudioFilterPresetName | Canonical built-in audio filter preset names. |
| CapabilityDecision | An explicit veto or replacement from a modern plugin. Undefined leaves the input unchanged. |
| ContextReceiver | Callback executed inside an asynchronous context scope. |
| CrossfadeOptions | Automatic PCM crossfading policy. Changes apply to newly created sessions only. |
| DiscordPlayerErrorCode | Error code union for Discord Player errors. |
| DiscordPlayerNode | A configured Remedia node snapshot/config type used by Player. |
| DiscordPlayerOptions | Options for a Discord Player instance and its Remedia client. |
| DispatchPolicy | Operation dispatch behavior. |
| Encodable | Compatibility alias for the supported serialized entity union. |
| ExtractorConstructor | Class constructors only: instances and modern plugin descriptors are not accepted. |
| ExtractorInfo | Legacy extractor result. |
| ExtractorResolvable | Legacy identifier or owned instance. |
| ExtractorStreamable | Legacy encoded source; format hints cannot restore the obsolete audio stack. |
| GuildQueueEvents | Union of familiar guild queue event names. |
| GuildQueueResolvable | Guild ID or a structural guild-like object. |
| JSONPrimitive | JSON scalar value accepted by Discord Player persistence payloads. |
| JSONValue | Deep JSON-compatible value accepted by the serialization contract. |
| LyricsCallback | Lyric notification callback. |
| LyricsData | Read-only timestamp/text view, compatible with v7 lyric-map inspection. |
| MediaResource | Media accepted by the public player orchestration API. Strings are dispatched to source plugins. |
| MetadataDispatch | Read and write queue metadata. |
| NativeSessionObservation | Discriminated native session observation, including events rejected by queue correlation. |
| NextFunction | Legacy post-stream callback. |
| NodeResolvable | A guild queue instance or any value that can resolve to one. |
| OnAfterCreateStreamHandler | Local encoded-byte hook; unavailable when Remedia owns the bytes. |
| OnBeforeCreateStreamHandler | Source interception before normal provider resolution. |
| OnStreamExtractedHandler | Descriptor interception after provider resolution. |
| OperationHandler | A handler may decline only by returning undefined. |
| OperationInput | Typed input selected by operation name. |
| OperationName | Names available to source plugins. |
| OperationOutput | Typed handler result selected by operation name. |
| OperationResult | Dispatch result selected by the declared policy. |
| PlaybackBackendEvents | Shared session event schemas. Backends emit their real events with original generation metadata. |
| PlaybackSessionOptions | Session creation settings; node placement is specific to the default Remedia backend. |
| PlaybackSource | Encoded media descriptor accepted by the framework source pipeline. |
| PlayerChannelResolvable | Supported channel argument for Player.play(). |
| PlayerEvent | Player-level event name union. |
| PlayerNodeInitializerOptions | Compatibility name for the v7-style initializer options. |
| PlayerTriggeredReason | Reason attached to the familiar playerTrigger event. |
| PluginFactory | Factory requires options only when the options type has required fields. |
| ProviderReference | Serializable provider identity; never put credentials or live objects in this payload. |
| QueueEventObservation | Actual public queue event arguments, after the queue object, in their documented order. |
| QueueEventParams | Event parameter tuple with the owning queue prepended. |
| QueueRepeatMode | A supported queue repeat mode. |
| RawPlaybackTerminalEvent | Remedia event variants that can end a raw playback generation. |
| RawTrackData | Legacy raw construction fields; live engines and callbacks remain process-local. |
| SearchQueryType | Legacy query hint, including provider-defined string values. |
| SerializedEntity | A versioned, discriminated serialized entity. |
| SerializedEntityUnion | Versioned persistence entities supported by Discord Player. |
| SerializedPlaylist | Version 1 persistence representation of a Playlist. |
| SerializedPlaylistData | Public Playlist fields stored by the versioned persistence format. |
| SerializedTrack | Version 1 persistence representation of a Track. |
| SerializedTrackData | Public Track fields stored by the versioned persistence format. |
| SetterFN | Functional metadata update. |
| SourceStream | Supported local source results. Readables and byte buffers require embedded Remedia. |
| TrackRequester | Requester identifier or a structural requester object. |
| TrackResolvable | A track identifier accepted by queue navigation and mutation methods. |
| TrackSource | Name or identifier for a Track's source integration. |
| VolumeDispatch | Read and write queue volume, awaited because Remedia applies gain asynchronously. |
| VolumeSetterFN | Functional volume update. |
| WithMetadata | Legacy metadata refinement for custom extractor helpers. |
Variables
| AudioFilter | |
| AudioFilterPresets | Fixed v7-compatible FFmpeg filtergraph presets. Native validation remains owned by Remedia. |
| DiscordPlayerErrorCode | Public error codes for Discord Player's application-level failures. |
| GuildQueueEvents | Familiar event names emitted by GuildQueue instances through player.events. |
| PlayerEvent | Familiar Player-level event names. |
| QueryType | Legacy 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. |
| QueueRepeatMode | Repeat policy applied after a managed playback generation reaches a terminal event. |
| SERIALIZATION_SCHEMA_VERSION | Current Discord Player serialization schema version, independent of package versions. |
| SerializedType | Entity discriminator values used in versioned persistence payloads. |
| Util | Small metadata helpers; obsolete voice and transcoding helpers are intentionally unavailable. |
Re-exports
| Player | Familiar OOP Player facade for guild queues and the Remedia client. |