Discord Player

ExtractorExecutionContext

No description provided

ExtractorExecutionContext extends PlayerEventsEmitter<ExtractorExecutionEvents>

new ExtractorExecutionContext(player);
ParameterTypeOptional
playerPlayer

Properties

public context: any

public player: any

public requiredEvents: any

public store: any

The extractors store

public static defaultMaxListeners: any

public hasDebugger: any

public size: any

The size of registered extractors

Methods

public addListener(name, listener): ExtractorExecutionContext

ParameterTypeOptional
nameK
listenerExtractorExecutionEvents[K]

public emit(name, args): boolean

ParameterTypeOptional
nameK
argsParameters<ExtractorExecutionEvents[K]>

public eventNames(): Array<U>

public get(identifier): undefined | BaseExtractor<object>

Get single extractor

ParameterTypeOptionalDescription
identifierstringThe extractor to get

public getContext(): null | ExtractorSession

Get the current execution context

public getExecutionId(): null | string

Get the current execution id

public getMaxListeners(): number

public isDisabled(identifier): boolean

Check if extractor is disabled

ParameterTypeOptional
identifierstring

public isEnabled(identifier): boolean

Check if extractor is enabled

ParameterTypeOptional
identifierstring

public isRegistered(identifier): boolean

Validate if the given extractor is registered

ParameterTypeOptionalDescription
identifierstringThe extractor identifier

public listenerCount(type): number

ParameterTypeOptional
typekeyof ExtractorExecutionEvents

public listeners(type): Array

ParameterTypeOptional
typeU

public loadDefault(): Promise<void>

public loadMulti(bundle, options): Promise<{

error | : null | ; success | : boolean | ; }> Load a bundle of extractors.

import { DefaultExtractors } from '@discord-player/extractor';
 
await player.extractors.loadMulti(DefaultExtractors);
ParameterTypeOptional
bundleT
optionsR

public off(name, listener): ExtractorExecutionContext

ParameterTypeOptional
nameK
listenerExtractorExecutionEvents[K]

public on(name, listener): ExtractorExecutionContext

ParameterTypeOptional
nameK
listenerExtractorExecutionEvents[K]

public once(name, listener): ExtractorExecutionContext

ParameterTypeOptional
nameK
listenerExtractorExecutionEvents[K]

public prependListener(event, listener): this

ParameterTypeOptional
eventU
listenerExtractorExecutionEvents[U]

public prependOnceListener(event, listener): this

ParameterTypeOptional
eventU
listenerExtractorExecutionEvents[U]

public rawListeners(type): Array<ExtractorExecutionEvents[U]>

ParameterTypeOptional
typeU

public register(_extractor, options): Promise<null | InstanceType<T>>

Register single extractor

ParameterTypeOptionalDescription
_extractorTThe extractor to register
optionsConstructorParameters<T>['1']Options supplied to the extractor

public removeAllListeners(name?): ExtractorExecutionContext

ParameterTypeOptional
nameK

public removeListener(name, listener): ExtractorExecutionContext

ParameterTypeOptional
nameK
listenerExtractorExecutionEvents[K]

public requestBridge(track, sourceExtractor): Promise<ExtractorExecutionResult<ExtractorStreamable>>

Request bridge for a track

ParameterTypeOptionalDescription
trackTrack<unknown>The track to request bridge for
sourceExtractornull | BaseExtractor<object>The source extractor of the track

public requestBridgeFrom(track, sourceExtractor, targetExtractor): Promise<null | ExtractorStreamable>

Request bridge from the specified extractor

ParameterTypeOptionalDescription
trackTrack<unknown>The track to request bridge for
sourceExtractornull | BaseExtractor<object>The source extractor of the track
targetExtractorExtractorResolvableThe target extractor to bridge to

public resolve(resolvable): undefined | BaseExtractor<object>

Resolve extractor

ParameterTypeOptional
resolvableExtractorResolvable

public resolveId(resolvable): string

Resolve extractor identifier

ParameterTypeOptional
resolvableExtractorResolvable

public run(fn, filterBlocked): Promise<undefined | ExtractorExecutionResult<false>ExtractorExecutionResult<T>>

Run all the extractors

ParameterTypeOptionalDescription
fnExtractorExecutionFN<T>The runner function
filterBlockedbooleanFilter blocked extractors

public setMaxListeners(n): this

ParameterTypeOptional
nnumber

public unregister(_extractor): Promise<void>

Unregister single extractor

ParameterTypeOptionalDescription
_extractorKThe extractor to unregister

public unregisterAll(): Promise<void>

Unregister all extractors

On this page

ExtractorExecutionContext extends PlayerEventsEmitter<ExtractorExecutionEvents>Propertiespublic context: anypublic player: anypublic requiredEvents: anypublic store: anypublic static defaultMaxListeners: anypublic hasDebugger: anypublic size: anyMethodspublic addListener(name, listener): ExtractorExecutionContextpublic emit(name, args): booleanpublic eventNames(): Array<U>public get(identifier): undefined | BaseExtractor<object>public getContext(): null | ExtractorSessionpublic getExecutionId(): null | stringpublic getMaxListeners(): numberpublic isDisabled(identifier): booleanpublic isEnabled(identifier): booleanpublic isRegistered(identifier): booleanpublic listenerCount(type): numberpublic listeners(type): Arraypublic loadDefault(): Promise<void>public loadMulti(bundle, options): Promise<{public off(name, listener): ExtractorExecutionContextpublic on(name, listener): ExtractorExecutionContextpublic once(name, listener): ExtractorExecutionContextpublic prependListener(event, listener): thispublic prependOnceListener(event, listener): thispublic rawListeners(type): Array<ExtractorExecutionEvents[U]>public register(_extractor, options): Promise<null | InstanceType<T>>public removeAllListeners(name?): ExtractorExecutionContextpublic removeListener(name, listener): ExtractorExecutionContextpublic requestBridge(track, sourceExtractor): Promise<ExtractorExecutionResult<ExtractorStreamable>>public requestBridgeFrom(track, sourceExtractor, targetExtractor): Promise<null | ExtractorStreamable>public resolve(resolvable): undefined | BaseExtractor<object>public resolveId(resolvable): stringpublic run(fn, filterBlocked): Promise<undefined | ExtractorExecutionResult<false>ExtractorExecutionResult<T>>public setMaxListeners(n): thispublic unregister(_extractor): Promise<void>public unregisterAll(): Promise<void>