BaseExtractor
No description provided
BaseExtractor
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| context | ExtractorExecutionContext | ❌ | Context that instantiated this extractor | 
| options | T | ❌ | Initialization options for this extractor | 
Properties
public context: any
Context that instantiated this extractor
public options: any
Initialization options for this extractor
public priority: any
Priority of this extractor. Higher value means higher priority (will be executed first).
public protocols: any
A list of query protocols that this extractor supports.
public static identifier: any
Identifier for this extractor
public identifier: any
Identifier of this extractor
public supportsDemux: any
A flag to indicate Demuxable stream support for opus/ogg/opus/webm/opus formats.
Methods
public activate(): Promise<void>
This method will be executed when this extractor is activated
public bridge(track, sourceExtractor): Promise<null | ExtractorStreamable>
Handle stream extraction for another extractor
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| track | Track<unknown> | ❌ | The track to bridge | 
| sourceExtractor | null | BaseExtractor<object> | ❌ | The source extractor | 
public createBridgeQuery(track): string
Handle bridge query creation
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| track | Track<unknown> | ❌ | The track to build query for | 
public createResponse(playlist?, tracks): ExtractorInfo
Create extractor response
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| playlist | null | Playlist | ✅ | The playlist | 
| tracks | Array<Track<unknown>> | ❌ | The track array | 
public deactivate(): Promise<void>
This method will be executed when this extractor is deactivated
public debug(message): boolean
Write debug message
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| message | string | ❌ | The debug message | 
public emit(event, args): boolean
Dispatch an event to the player
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| event | K | ❌ | The event to dispatch | 
| args | Parameters<PlayerEvents[K]> | ❌ | The data to dispatch | 
public getRelatedTracks(track, history): Promise<ExtractorInfo>
Get related tracks for the given track
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| track | Track<unknown> | ❌ | The track source | 
| history | GuildQueueHistory<unknown> | ❌ | N/A | 
public handle(query, context): Promise<ExtractorInfo>
Handle the given query
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| query | string | ❌ | The query to handle | 
| context | ExtractorSearchContext | ❌ | N/A | 
public handlePostStream(stream, next): void
A stream middleware to handle streams before passing it to the player
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| stream | Readable | ❌ | The incoming stream | 
| next | NextFunction | ❌ | The next function | 
public reconfigure(options): Promise<void>
Reconfigures this extractor
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| options | T | ❌ | The new options to apply | 
public stream(info): Promise<ExtractorStreamable>
Stream the given track
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| info | Track<unknown> | ❌ | The track to stream | 
public validate(query, type?): Promise<boolean>
Validate incoming query
| Parameter | Type | Optional | Description | 
|---|---|---|---|
| query | string | ❌ | The query to validate | 
| type | null | SearchQueryType | ✅ | N/A |