Discord Player

LegacyPlayerContext

Source-related Player surface shared by actual Players and standalone hosts.

You are reading the v8 docsDev
InterfaceTypeScript@discord-player/plugin-host
View sourcepackages/plugin-host/src/legacy-player.ts:21
interface LegacyPlayerContext

Source-related Player surface shared by actual Players and standalone hosts.

Properties

pluginsreadonly

readonly plugins: PluginRegistry

Shared source registry.

extractorsreadonly

readonly extractors: ExtractorExecutionContext

Legacy extractor registration and lookup.

optionsreadonly

readonly options: {
  blockExtractors?: readonly string[];
  probeTimeout?: number;
}

Supported source options.

emit

emit: <E extends string | symbol>(eventName: "debug" | "error" | "voiceStateUpdate" | E | keyof EventEmitterEventMap, ...args: E extends keyof SourceRuntimeEvents ? SourceRuntimeEvents[E] : E extends keyof EventEmitterEventMap ? EventEmitterEventMap[E] : any[]) => boolean

Publish a supported event.

Methods

getRemedia

getRemedia(): RemediaClient

Access the embedding audio client; standalone contexts reject required access.

Returns

RemediaClient

getRemedia(throwOnMissing: false): RemediaClient | null

Optional audio client lookup, null in standalone execution.

Parameters

NameTypeDescription
throwOnMissingfalse

Optional lookup flag.

Returns

RemediaClient | null

search(query: MediaResource, options?: SearchOptions): Promise<SearchResult>

Search registered providers.

Parameters

NameTypeDescription
queryMediaResource

Query or existing metadata.

options?SearchOptions

Source hints and cancellation.

Returns

Promise<SearchResult>

debug

debug(message: string): void

Report a diagnostic.

Parameters

NameTypeDescription
messagestring

Diagnostic text.

Returns

void

On this page