discord-player 6.7.1 → 6.8.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/index.d.ts +196 -164
- package/dist/index.js +660 -311
- package/dist/index.mjs +8 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -25,6 +25,9 @@ Discord Player is a robust framework for developing Discord Music bots using Jav
|
|
|
25
25
|
- Out-of-the-box voice states handling
|
|
26
26
|
- IP Rotation support
|
|
27
27
|
- Easy serialization and deserialization
|
|
28
|
+
- Limited support for [Eris](https://npmjs.com/eris)
|
|
29
|
+
|
|
30
|
+
> Eris compat mode does not support `VoiceStateUpdate` handler. You need to handle it manually.
|
|
28
31
|
|
|
29
32
|
## Installation
|
|
30
33
|
|
|
@@ -134,6 +137,16 @@ player.events.on('playerStart', (queue, track) => {
|
|
|
134
137
|
});
|
|
135
138
|
```
|
|
136
139
|
|
|
140
|
+
## Eris Setup
|
|
141
|
+
|
|
142
|
+
Discord Player has limited support for Eris. You can use the following code to set up Discord Player with Eris:
|
|
143
|
+
|
|
144
|
+
```js index.js
|
|
145
|
+
const { Player, createErisCompat } = require('discord-player');
|
|
146
|
+
|
|
147
|
+
const player = new Player(createErisCompat(client));
|
|
148
|
+
```
|
|
149
|
+
|
|
137
150
|
Let's move on to the command part. You can define the command as per your requirements. We will only focus on the command part:
|
|
138
151
|
|
|
139
152
|
```js play.js
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ListenerSignature, DefaultListener, EventEmitter, Queue, QueueStrategy, Collection } from '@discord-player/utils';
|
|
2
1
|
import * as discord_js from 'discord.js';
|
|
3
|
-
import { VoiceChannel, StageChannel, UserResolvable, Guild, VoiceState, VoiceBasedChannel, GuildVoiceChannelResolvable, User, Snowflake,
|
|
2
|
+
import { Client, VoiceChannel, StageChannel, UserResolvable, Guild, VoiceState, VoiceBasedChannel, GuildVoiceChannelResolvable, User, Snowflake, GuildResolvable } from 'discord.js';
|
|
3
|
+
import Eris from 'eris';
|
|
4
|
+
import { ListenerSignature, DefaultListener, EventEmitter, Queue, QueueStrategy, Collection } from '@discord-player/utils';
|
|
4
5
|
import * as _discord_player_equalizer from '@discord-player/equalizer';
|
|
5
6
|
import { EqualizerBand, BiquadFilters, PCMFilters, FiltersChain } from '@discord-player/equalizer';
|
|
6
7
|
export { AF_NIGHTCORE_RATE, AF_VAPORWAVE_RATE, BASS_EQ_BANDS, FilterType as BiquadFilterType, BiquadFilters, FiltersChain, AudioFilters as PCMAudioFilters, PCMFilters, Q_BUTTERWORTH, VolumeTransformer } from '@discord-player/equalizer';
|
|
7
8
|
import { Readable as Readable$1 } from 'node:stream';
|
|
8
9
|
import { StreamType, AudioPlayerError, AudioResource, VoiceConnection, AudioPlayer, AudioPlayerStatus, EndBehaviorType } from 'discord-voip';
|
|
9
|
-
export { AudioPlayer, CreateAudioPlayerOptions, createAudioPlayer } from 'discord-voip';
|
|
10
|
+
export { AudioPlayer, CreateAudioPlayerOptions, createAudioPlayer, getVoiceConnection, getVoiceConnections } from 'discord-voip';
|
|
10
11
|
import * as stream from 'stream';
|
|
11
12
|
import { Readable, Duplex } from 'stream';
|
|
12
13
|
import * as _discord_player_extractor from '@discord-player/extractor';
|
|
@@ -17,6 +18,14 @@ import { FFmpeg } from '@discord-player/ffmpeg';
|
|
|
17
18
|
export * from '@discord-player/ffmpeg';
|
|
18
19
|
import { downloadOptions } from 'ytdl-core';
|
|
19
20
|
|
|
21
|
+
declare function isErisProxy(client: any): client is Eris.Client;
|
|
22
|
+
/**
|
|
23
|
+
* Allows Eris clients to be used with discord-player. When this method is called, discord-player creates a proxy object that intercepts certain methods and properties to make it compatible with discord-player.
|
|
24
|
+
* @param client The Eris client to be used.
|
|
25
|
+
* @returns The Eris client with discord-player compatibility.
|
|
26
|
+
*/
|
|
27
|
+
declare function createErisCompat(client: Eris.Client): Client;
|
|
28
|
+
|
|
20
29
|
declare class PlayerEventsEmitter<L extends ListenerSignature<L> = DefaultListener> extends EventEmitter<L> {
|
|
21
30
|
#private;
|
|
22
31
|
requiredEvents: Array<keyof L>;
|
|
@@ -954,6 +963,7 @@ interface GuildNodeInit<Meta = unknown> {
|
|
|
954
963
|
disableFilterer: boolean;
|
|
955
964
|
disableBiquad: boolean;
|
|
956
965
|
disableResampler: boolean;
|
|
966
|
+
disableFallbackStream: boolean;
|
|
957
967
|
}
|
|
958
968
|
interface VoiceConnectConfig {
|
|
959
969
|
deaf?: boolean;
|
|
@@ -1590,12 +1600,15 @@ declare class Track<T = unknown> {
|
|
|
1590
1600
|
requestedBy: User | null;
|
|
1591
1601
|
playlist?: Playlist;
|
|
1592
1602
|
queryType: SearchQueryType | null | undefined;
|
|
1593
|
-
raw:
|
|
1603
|
+
raw: any;
|
|
1594
1604
|
extractor: BaseExtractor | null;
|
|
1595
1605
|
readonly id: string;
|
|
1596
1606
|
private __metadata;
|
|
1597
1607
|
private __reqMetadataFn;
|
|
1598
1608
|
cleanTitle: string;
|
|
1609
|
+
live: boolean;
|
|
1610
|
+
bridgedExtractor: BaseExtractor | null;
|
|
1611
|
+
bridgedTrack: Track | null;
|
|
1599
1612
|
/**
|
|
1600
1613
|
* Track constructor
|
|
1601
1614
|
* @param player The player that instantiated this Track
|
|
@@ -1633,7 +1646,7 @@ declare class Track<T = unknown> {
|
|
|
1633
1646
|
/**
|
|
1634
1647
|
* Returns source of this track
|
|
1635
1648
|
*/
|
|
1636
|
-
get source():
|
|
1649
|
+
get source(): any;
|
|
1637
1650
|
/**
|
|
1638
1651
|
* String representation of this track
|
|
1639
1652
|
*/
|
|
@@ -1654,7 +1667,7 @@ declare class Track<T = unknown> {
|
|
|
1654
1667
|
duration: string;
|
|
1655
1668
|
views: number;
|
|
1656
1669
|
requested_by: {} | null;
|
|
1657
|
-
source:
|
|
1670
|
+
source: any;
|
|
1658
1671
|
live: boolean;
|
|
1659
1672
|
query_type: SearchQueryType | null | undefined;
|
|
1660
1673
|
extractor: string | null;
|
|
@@ -1725,16 +1738,12 @@ declare class Playlist {
|
|
|
1725
1738
|
title: string;
|
|
1726
1739
|
description: string;
|
|
1727
1740
|
author: string;
|
|
1728
|
-
url: string;
|
|
1729
|
-
* Play this playlist to the given voice channel. If queue exists and another track is being played, this playlist will be added to the queue.
|
|
1730
|
-
* @param channel Voice channel on which this playlist shall be played
|
|
1731
|
-
* @param options Node initialization options
|
|
1732
|
-
*/
|
|
1741
|
+
url: string;
|
|
1733
1742
|
thumbnail: any;
|
|
1734
1743
|
duration: string;
|
|
1735
1744
|
views: number;
|
|
1736
1745
|
requested_by: {} | null;
|
|
1737
|
-
source:
|
|
1746
|
+
source: any;
|
|
1738
1747
|
live: boolean;
|
|
1739
1748
|
query_type: SearchQueryType | null | undefined;
|
|
1740
1749
|
extractor: string | null;
|
|
@@ -1770,10 +1779,165 @@ declare class Playlist {
|
|
|
1770
1779
|
play<T = unknown>(channel: GuildVoiceChannelResolvable, options?: PlayerNodeInitializerOptions<T>): Promise<PlayerNodeInitializationResult<T>>;
|
|
1771
1780
|
}
|
|
1772
1781
|
|
|
1782
|
+
type unsafe = any;
|
|
1783
|
+
/**
|
|
1784
|
+
* The receiver function that will be called when the context is provided
|
|
1785
|
+
*/
|
|
1786
|
+
type ContextReceiver<R> = () => R;
|
|
1787
|
+
declare class Context<T> {
|
|
1788
|
+
private defaultValue?;
|
|
1789
|
+
private storage;
|
|
1790
|
+
constructor(defaultValue?: T | undefined);
|
|
1791
|
+
/**
|
|
1792
|
+
* Exit out of this context
|
|
1793
|
+
*/
|
|
1794
|
+
exit(scope: ContextReceiver<void>): void;
|
|
1795
|
+
/**
|
|
1796
|
+
* Whether the context is lost
|
|
1797
|
+
*/
|
|
1798
|
+
get isLost(): boolean;
|
|
1799
|
+
/**
|
|
1800
|
+
* Get the current value of the context. If the context is lost and no default value is provided, undefined will be returned.
|
|
1801
|
+
*/
|
|
1802
|
+
consume(): T | undefined;
|
|
1803
|
+
/**
|
|
1804
|
+
* Run a function within the context of this provider
|
|
1805
|
+
*/
|
|
1806
|
+
provide<R = unsafe>(value: T, receiver: ContextReceiver<R>): R;
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* Create a new context. The default value is optional.
|
|
1810
|
+
* @param defaultValue The default value of the context
|
|
1811
|
+
* @example const userContext = createContext();
|
|
1812
|
+
*
|
|
1813
|
+
* // the value to provide
|
|
1814
|
+
* const user = {
|
|
1815
|
+
* id: 1,
|
|
1816
|
+
* name: 'John Doe'
|
|
1817
|
+
* };
|
|
1818
|
+
*
|
|
1819
|
+
* // provide the context value to the receiver
|
|
1820
|
+
* context.provide(user, handler);
|
|
1821
|
+
*
|
|
1822
|
+
* function handler() {
|
|
1823
|
+
* // get the context value
|
|
1824
|
+
* const { id, name } = useContext(context);
|
|
1825
|
+
*
|
|
1826
|
+
* console.log(id, name); // 1, John Doe
|
|
1827
|
+
* }
|
|
1828
|
+
*/
|
|
1829
|
+
declare function createContext<T = unsafe>(defaultValue?: T): Context<T>;
|
|
1830
|
+
/**
|
|
1831
|
+
* Get the current value of the context. If the context is lost and no default value is provided, undefined will be returned.
|
|
1832
|
+
* @param context The context to get the value from
|
|
1833
|
+
* @example const value = useContext(context);
|
|
1834
|
+
*/
|
|
1835
|
+
declare function useContext<T = unsafe>(context: Context<T>): T | undefined;
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Fetch guild queue history
|
|
1839
|
+
* @param node guild queue node resolvable
|
|
1840
|
+
*/
|
|
1841
|
+
declare function useHistory<Meta = unknown>(): GuildQueueHistory<Meta> | null;
|
|
1842
|
+
declare function useHistory<Meta = unknown>(node: NodeResolvable): GuildQueueHistory<Meta> | null;
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* Fetch guild queue player node
|
|
1846
|
+
* @param node Guild queue node resolvable
|
|
1847
|
+
*/
|
|
1848
|
+
declare function usePlayer<Meta = unknown>(): GuildQueuePlayerNode<Meta> | null;
|
|
1849
|
+
declare function usePlayer<Meta = unknown>(node: NodeResolvable): GuildQueuePlayerNode<Meta> | null;
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Fetch guild queue
|
|
1853
|
+
* @param node Guild queue node resolvable
|
|
1854
|
+
*/
|
|
1855
|
+
declare function useQueue<Meta = unknown>(): GuildQueue<Meta> | null;
|
|
1856
|
+
declare function useQueue<Meta = unknown>(node: NodeResolvable): GuildQueue<Meta> | null;
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* Fetch main player instance
|
|
1860
|
+
* @deprecated
|
|
1861
|
+
*/
|
|
1862
|
+
declare function useMasterPlayer(): Player;
|
|
1863
|
+
/**
|
|
1864
|
+
* Fetch main player instance
|
|
1865
|
+
*/
|
|
1866
|
+
declare function useMainPlayer(): Player;
|
|
1867
|
+
|
|
1868
|
+
type SetterFN$1<T, P> = (previous: P) => T;
|
|
1869
|
+
type MetadataDispatch<T> = readonly [() => T, (metadata: T | SetterFN$1<T, T>) => void];
|
|
1870
|
+
/**
|
|
1871
|
+
* Fetch or manipulate guild queue metadata
|
|
1872
|
+
* @param node Guild queue node resolvable
|
|
1873
|
+
*/
|
|
1874
|
+
declare function useMetadata<T = unknown>(): MetadataDispatch<T>;
|
|
1875
|
+
declare function useMetadata<T = unknown>(node: NodeResolvable): MetadataDispatch<T>;
|
|
1876
|
+
|
|
1877
|
+
interface TimelineDispatcherOptions {
|
|
1878
|
+
ignoreFilters: boolean;
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Fetch or manipulate current track
|
|
1882
|
+
* @param node Guild queue node resolvable
|
|
1883
|
+
* @param options Options for timeline dispatcher
|
|
1884
|
+
*/
|
|
1885
|
+
declare function useTimeline(node?: NodeResolvable, options?: Partial<TimelineDispatcherOptions>): {
|
|
1886
|
+
readonly timestamp: PlayerTimestamp;
|
|
1887
|
+
readonly volume: number;
|
|
1888
|
+
readonly paused: boolean;
|
|
1889
|
+
readonly track: Track<unknown> | null;
|
|
1890
|
+
pause(): boolean;
|
|
1891
|
+
resume(): boolean;
|
|
1892
|
+
setVolume(vol: number): boolean;
|
|
1893
|
+
setPosition(time: number): Promise<boolean>;
|
|
1894
|
+
} | null;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* Global onAfterCreateStream handler
|
|
1898
|
+
* @param handler The handler callback
|
|
1899
|
+
*/
|
|
1900
|
+
declare function onAfterCreateStream(handler: OnAfterCreateStreamHandler): void;
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* Global onBeforeCreateStream handler
|
|
1904
|
+
* @param handler The handler callback
|
|
1905
|
+
*/
|
|
1906
|
+
declare function onBeforeCreateStream(handler: OnBeforeCreateStreamHandler): void;
|
|
1907
|
+
|
|
1908
|
+
type SetterFN = (previous: number) => number;
|
|
1909
|
+
type VolumeDispatch = readonly [() => number, (volume: number | SetterFN) => boolean | undefined];
|
|
1910
|
+
/**
|
|
1911
|
+
* Fetch or manipulate player volume
|
|
1912
|
+
* @param node Guild queue node resolvable
|
|
1913
|
+
*/
|
|
1914
|
+
declare function useVolume(): VolumeDispatch;
|
|
1915
|
+
declare function useVolume(node: NodeResolvable): VolumeDispatch;
|
|
1916
|
+
|
|
1917
|
+
declare const instances: Collection<string, Player>;
|
|
1918
|
+
|
|
1919
|
+
declare const getPlayer: () => Player | null;
|
|
1920
|
+
interface HooksCtx {
|
|
1921
|
+
guild: Guild;
|
|
1922
|
+
}
|
|
1923
|
+
declare const getQueue: <T = unknown>(node: NodeResolvable) => GuildQueue<T> | null;
|
|
1924
|
+
interface HookDeclarationContext {
|
|
1925
|
+
getQueue: typeof getQueue;
|
|
1926
|
+
getPlayer: typeof getPlayer;
|
|
1927
|
+
instances: typeof instances;
|
|
1928
|
+
}
|
|
1929
|
+
type HookDeclaration<T extends (...args: any[]) => any> = (context: HookDeclarationContext) => T;
|
|
1930
|
+
declare function createHook<T extends HookDeclaration<(...args: any[]) => any>>(hook: T): ReturnType<T>;
|
|
1931
|
+
|
|
1773
1932
|
declare const knownExtractorKeys: readonly ["SpotifyExtractor", "AppleMusicExtractor", "SoundCloudExtractor", "YouTubeExtractor", "VimeoExtractor", "ReverbnationExtractor", "AttachmentExtractor"];
|
|
1774
1933
|
type ExtractorLoaderOptionDict = {
|
|
1775
1934
|
[K in (typeof knownExtractorKeys)[number]]?: ConstructorParameters<typeof _discord_player_extractor[K]>[1];
|
|
1776
1935
|
};
|
|
1936
|
+
interface ExtractorSession {
|
|
1937
|
+
id: string;
|
|
1938
|
+
attemptedExtractors: Set<string>;
|
|
1939
|
+
bridgeAttemptedExtractors: Set<string>;
|
|
1940
|
+
}
|
|
1777
1941
|
interface ExtractorExecutionEvents {
|
|
1778
1942
|
/**
|
|
1779
1943
|
* Emitted when a extractor is registered
|
|
@@ -1812,7 +1976,16 @@ declare class ExtractorExecutionContext extends PlayerEventsEmitter<ExtractorExe
|
|
|
1812
1976
|
* The extractors store
|
|
1813
1977
|
*/
|
|
1814
1978
|
store: Collection<string, BaseExtractor<object>>;
|
|
1979
|
+
readonly context: Context<ExtractorSession>;
|
|
1815
1980
|
constructor(player: Player);
|
|
1981
|
+
/**
|
|
1982
|
+
* Get the current execution id
|
|
1983
|
+
*/
|
|
1984
|
+
getExecutionId(): string | null;
|
|
1985
|
+
/**
|
|
1986
|
+
* Get the current execution context
|
|
1987
|
+
*/
|
|
1988
|
+
getContext(): ExtractorSession | null;
|
|
1816
1989
|
/**
|
|
1817
1990
|
* Load default extractors from `@discord-player/extractor`
|
|
1818
1991
|
*/
|
|
@@ -1863,7 +2036,7 @@ declare class ExtractorExecutionContext extends PlayerEventsEmitter<ExtractorExe
|
|
|
1863
2036
|
* @param track The track to request bridge for
|
|
1864
2037
|
* @param sourceExtractor The source extractor of the track
|
|
1865
2038
|
*/
|
|
1866
|
-
requestBridge(track: Track, sourceExtractor?: BaseExtractor | null): Promise<ExtractorExecutionResult<
|
|
2039
|
+
requestBridge(track: Track, sourceExtractor?: BaseExtractor | null): Promise<ExtractorExecutionResult<ExtractorStreamable>>;
|
|
1867
2040
|
/**
|
|
1868
2041
|
* Request bridge from the specified extractor
|
|
1869
2042
|
* @param track The track to request bridge for
|
|
@@ -2206,156 +2379,6 @@ declare class IPRotator {
|
|
|
2206
2379
|
static getRandomIP(address: string, start?: number, end?: number): string;
|
|
2207
2380
|
}
|
|
2208
2381
|
|
|
2209
|
-
type unsafe = any;
|
|
2210
|
-
/**
|
|
2211
|
-
* The receiver function that will be called when the context is provided
|
|
2212
|
-
*/
|
|
2213
|
-
type ContextReceiver<R> = () => R;
|
|
2214
|
-
declare class Context<T> {
|
|
2215
|
-
private defaultValue?;
|
|
2216
|
-
private storage;
|
|
2217
|
-
constructor(defaultValue?: T | undefined);
|
|
2218
|
-
/**
|
|
2219
|
-
* Exit out of this context
|
|
2220
|
-
*/
|
|
2221
|
-
exit(scope: ContextReceiver<void>): void;
|
|
2222
|
-
/**
|
|
2223
|
-
* Whether the context is lost
|
|
2224
|
-
*/
|
|
2225
|
-
get isLost(): boolean;
|
|
2226
|
-
/**
|
|
2227
|
-
* Get the current value of the context. If the context is lost and no default value is provided, undefined will be returned.
|
|
2228
|
-
*/
|
|
2229
|
-
consume(): T | undefined;
|
|
2230
|
-
/**
|
|
2231
|
-
* Run a function within the context of this provider
|
|
2232
|
-
*/
|
|
2233
|
-
provide<R = unsafe>(value: T, receiver: ContextReceiver<R>): R;
|
|
2234
|
-
}
|
|
2235
|
-
/**
|
|
2236
|
-
* Create a new context. The default value is optional.
|
|
2237
|
-
* @param defaultValue The default value of the context
|
|
2238
|
-
* @example const userContext = createContext();
|
|
2239
|
-
*
|
|
2240
|
-
* // the value to provide
|
|
2241
|
-
* const user = {
|
|
2242
|
-
* id: 1,
|
|
2243
|
-
* name: 'John Doe'
|
|
2244
|
-
* };
|
|
2245
|
-
*
|
|
2246
|
-
* // provide the context value to the receiver
|
|
2247
|
-
* context.provide(user, handler);
|
|
2248
|
-
*
|
|
2249
|
-
* function handler() {
|
|
2250
|
-
* // get the context value
|
|
2251
|
-
* const { id, name } = useContext(context);
|
|
2252
|
-
*
|
|
2253
|
-
* console.log(id, name); // 1, John Doe
|
|
2254
|
-
* }
|
|
2255
|
-
*/
|
|
2256
|
-
declare function createContext<T = unsafe>(defaultValue?: T): Context<T>;
|
|
2257
|
-
/**
|
|
2258
|
-
* Get the current value of the context. If the context is lost and no default value is provided, undefined will be returned.
|
|
2259
|
-
* @param context The context to get the value from
|
|
2260
|
-
* @example const value = useContext(context);
|
|
2261
|
-
*/
|
|
2262
|
-
declare function useContext<T = unsafe>(context: Context<T>): T | undefined;
|
|
2263
|
-
|
|
2264
|
-
/**
|
|
2265
|
-
* Fetch guild queue history
|
|
2266
|
-
* @param node guild queue node resolvable
|
|
2267
|
-
*/
|
|
2268
|
-
declare function useHistory<Meta = unknown>(): GuildQueueHistory<Meta> | null;
|
|
2269
|
-
declare function useHistory<Meta = unknown>(node: NodeResolvable): GuildQueueHistory<Meta> | null;
|
|
2270
|
-
|
|
2271
|
-
/**
|
|
2272
|
-
* Fetch guild queue player node
|
|
2273
|
-
* @param node Guild queue node resolvable
|
|
2274
|
-
*/
|
|
2275
|
-
declare function usePlayer<Meta = unknown>(): GuildQueuePlayerNode<Meta> | null;
|
|
2276
|
-
declare function usePlayer<Meta = unknown>(node: NodeResolvable): GuildQueuePlayerNode<Meta> | null;
|
|
2277
|
-
|
|
2278
|
-
/**
|
|
2279
|
-
* Fetch guild queue
|
|
2280
|
-
* @param node Guild queue node resolvable
|
|
2281
|
-
*/
|
|
2282
|
-
declare function useQueue<Meta = unknown>(): GuildQueue<Meta> | null;
|
|
2283
|
-
declare function useQueue<Meta = unknown>(node: NodeResolvable): GuildQueue<Meta> | null;
|
|
2284
|
-
|
|
2285
|
-
/**
|
|
2286
|
-
* Fetch main player instance
|
|
2287
|
-
* @deprecated
|
|
2288
|
-
*/
|
|
2289
|
-
declare function useMasterPlayer(): Player;
|
|
2290
|
-
/**
|
|
2291
|
-
* Fetch main player instance
|
|
2292
|
-
*/
|
|
2293
|
-
declare function useMainPlayer(): Player;
|
|
2294
|
-
|
|
2295
|
-
type SetterFN$1<T, P> = (previous: P) => T;
|
|
2296
|
-
type MetadataDispatch<T> = readonly [() => T, (metadata: T | SetterFN$1<T, T>) => void];
|
|
2297
|
-
/**
|
|
2298
|
-
* Fetch or manipulate guild queue metadata
|
|
2299
|
-
* @param node Guild queue node resolvable
|
|
2300
|
-
*/
|
|
2301
|
-
declare function useMetadata<T = unknown>(): MetadataDispatch<T>;
|
|
2302
|
-
declare function useMetadata<T = unknown>(node: NodeResolvable): MetadataDispatch<T>;
|
|
2303
|
-
|
|
2304
|
-
interface TimelineDispatcherOptions {
|
|
2305
|
-
ignoreFilters: boolean;
|
|
2306
|
-
}
|
|
2307
|
-
/**
|
|
2308
|
-
* Fetch or manipulate current track
|
|
2309
|
-
* @param node Guild queue node resolvable
|
|
2310
|
-
* @param options Options for timeline dispatcher
|
|
2311
|
-
*/
|
|
2312
|
-
declare function useTimeline(node?: NodeResolvable, options?: Partial<TimelineDispatcherOptions>): {
|
|
2313
|
-
readonly timestamp: PlayerTimestamp;
|
|
2314
|
-
readonly volume: number;
|
|
2315
|
-
readonly paused: boolean;
|
|
2316
|
-
readonly track: Track<unknown> | null;
|
|
2317
|
-
pause(): boolean;
|
|
2318
|
-
resume(): boolean;
|
|
2319
|
-
setVolume(vol: number): boolean;
|
|
2320
|
-
setPosition(time: number): Promise<boolean>;
|
|
2321
|
-
} | null;
|
|
2322
|
-
|
|
2323
|
-
/**
|
|
2324
|
-
* Global onAfterCreateStream handler
|
|
2325
|
-
* @param handler The handler callback
|
|
2326
|
-
*/
|
|
2327
|
-
declare function onAfterCreateStream(handler: OnAfterCreateStreamHandler): void;
|
|
2328
|
-
|
|
2329
|
-
/**
|
|
2330
|
-
* Global onBeforeCreateStream handler
|
|
2331
|
-
* @param handler The handler callback
|
|
2332
|
-
*/
|
|
2333
|
-
declare function onBeforeCreateStream(handler: OnBeforeCreateStreamHandler): void;
|
|
2334
|
-
|
|
2335
|
-
type SetterFN = (previous: number) => number;
|
|
2336
|
-
type VolumeDispatch = readonly [() => number, (volume: number | SetterFN) => boolean | undefined];
|
|
2337
|
-
/**
|
|
2338
|
-
* Fetch or manipulate player volume
|
|
2339
|
-
* @param node Guild queue node resolvable
|
|
2340
|
-
*/
|
|
2341
|
-
declare function useVolume(): VolumeDispatch;
|
|
2342
|
-
declare function useVolume(node: NodeResolvable): VolumeDispatch;
|
|
2343
|
-
|
|
2344
|
-
declare const instances: Collection<string, Player>;
|
|
2345
|
-
|
|
2346
|
-
declare const getPlayer: () => Player | null;
|
|
2347
|
-
interface HooksCtx {
|
|
2348
|
-
guild: Guild;
|
|
2349
|
-
}
|
|
2350
|
-
declare const getQueue: <T = unknown>(node: NodeResolvable) => GuildQueue<T> | null;
|
|
2351
|
-
interface HookDeclarationContext {
|
|
2352
|
-
getQueue: typeof getQueue;
|
|
2353
|
-
getPlayer: typeof getPlayer;
|
|
2354
|
-
instances: typeof instances;
|
|
2355
|
-
}
|
|
2356
|
-
type HookDeclaration<T extends (...args: any[]) => any> = (context: HookDeclarationContext) => T;
|
|
2357
|
-
declare function createHook<T extends HookDeclaration<(...args: any[]) => any>>(hook: T): ReturnType<T>;
|
|
2358
|
-
|
|
2359
2382
|
interface PlayerNodeInitializationResult<T = unknown> {
|
|
2360
2383
|
track: Track;
|
|
2361
2384
|
extractor: BaseExtractor | null;
|
|
@@ -2495,6 +2518,10 @@ declare class Player extends PlayerEventsEmitter<PlayerEvents> {
|
|
|
2495
2518
|
queryCacheEnabled: boolean;
|
|
2496
2519
|
queues: GuildQueueStatisticsMetadata[];
|
|
2497
2520
|
};
|
|
2521
|
+
/**
|
|
2522
|
+
* Whether the player is in compatibility mode. Compatibility mode is enabled when non-discord.js client is used.
|
|
2523
|
+
*/
|
|
2524
|
+
isCompatMode(): boolean;
|
|
2498
2525
|
/**
|
|
2499
2526
|
* Destroy every single queues managed by this master player instance
|
|
2500
2527
|
* @example ```typescript
|
|
@@ -2611,6 +2638,7 @@ interface GuildNodeCreateOptions<T = unknown> {
|
|
|
2611
2638
|
disableFilterer?: boolean;
|
|
2612
2639
|
disableBiquad?: boolean;
|
|
2613
2640
|
disableResampler?: boolean;
|
|
2641
|
+
disableFallbackStream?: boolean;
|
|
2614
2642
|
}
|
|
2615
2643
|
type NodeResolvable = GuildQueue | GuildResolvable;
|
|
2616
2644
|
declare class GuildNodeManager<Meta = unknown> {
|
|
@@ -3149,6 +3177,10 @@ interface PlayerInitOptions {
|
|
|
3149
3177
|
* The probe timeout in milliseconds. Defaults to 5000.
|
|
3150
3178
|
*/
|
|
3151
3179
|
probeTimeout?: number;
|
|
3180
|
+
/**
|
|
3181
|
+
* Configure ffmpeg path
|
|
3182
|
+
*/
|
|
3183
|
+
ffmpegPath?: string;
|
|
3152
3184
|
}
|
|
3153
3185
|
|
|
3154
3186
|
declare class AudioFilters {
|
|
@@ -3329,4 +3361,4 @@ declare class QueryResolver {
|
|
|
3329
3361
|
|
|
3330
3362
|
declare const version: string;
|
|
3331
3363
|
|
|
3332
|
-
export { AFilterGraph, AsyncQueue, AsyncQueueAcquisitionOptions, AsyncQueueEntry, AsyncQueueExceptionHandler, AudioFilters, BaseExtractor, Context, ContextReceiver, CreateStreamOps, DiscordPlayerQueryResultCache, Encodable, EqualizerConfigurationPreset, ExtractorExecutionContext, ExtractorExecutionEvents, ExtractorExecutionFN, ExtractorExecutionResult, ExtractorInfo, ExtractorLoaderOptionDict, ExtractorResolvable, ExtractorSearchContext, ExtractorStreamable, FFMPEG_ARGS_PIPED, FFMPEG_ARGS_STRING, FFMPEG_SRATE_REGEX, FFmpegFilterer, FFmpegStreamOptions, FilterGraph, FiltersName, GuildNodeCreateOptions, GuildNodeInit, GuildNodeManager, GuildQueue, GuildQueueAFiltersCache, GuildQueueAudioFilters, GuildQueueEvent, GuildQueueEvents, GuildQueueHistory, GuildQueuePlayerNode, GuildQueueStatistics, GuildQueueStatisticsMetadata, HookDeclaration, HookDeclarationContext, IPBlock, IPRotationConfig, IPRotator, LrcGetParams, LrcGetResult, LrcLib, LrcSearchParams, LrcSearchResult, MetadataDispatch, NextFunction, NodeResolvable, OnAfterCreateStreamHandler, OnBeforeCreateStreamHandler, PlayOptions, Player, PlayerEvent, PlayerEvents, PlayerEventsEmitter, PlayerInitOptions, PlayerNodeInitializationResult, PlayerNodeInitializerOptions, PlayerProgressbarOptions, PlayerSearchResult, PlayerTimestamp, PlayerTriggeredReason, Playlist, PlaylistInitData, PlaylistJSON, PostProcessedResult, QueryCache, QueryCacheOptions, QueryCacheProvider, QueryCacheResolverContext, QueryExtractorSearch, QueryResolver, QueryType, QueueFilters, QueueRepeatMode, RawTrackData, RawTrackInit, RequestEntity, ResolvedQuery, ResourcePlayOptions, Runtime, RuntimeType, SearchOptions, SearchQueryType, SearchResult, SearchResultData, SequentialBucket, SerializedPlaylist, SerializedTrack, SerializedType, SetterFN$1 as SetterFN, SkipOptions, StreamConfig, StreamDispatcher, TimeData, TimelineDispatcherOptions, Track, TrackJSON, TrackLike, TrackResolvable, TrackSkipReason, TrackSource, TypeUtil, Util, VALIDATE_QUEUE_CAP, VoiceConnectConfig, VoiceEvents, VoiceReceiverNode, VoiceReceiverOptions, VoiceStateHandler, VoiceUtils, WithMetadata, createContext, createFFmpegStream, createHook, decode, deserialize, encode, onAfterCreateStream, onBeforeCreateStream, serialize, tryIntoThumbnailString, useContext, useHistory, useMainPlayer, useMasterPlayer, useMetadata, usePlayer, useQueue, useTimeline, useVolume, version };
|
|
3364
|
+
export { AFilterGraph, AsyncQueue, AsyncQueueAcquisitionOptions, AsyncQueueEntry, AsyncQueueExceptionHandler, AudioFilters, BaseExtractor, Context, ContextReceiver, CreateStreamOps, DiscordPlayerQueryResultCache, Encodable, EqualizerConfigurationPreset, ExtractorExecutionContext, ExtractorExecutionEvents, ExtractorExecutionFN, ExtractorExecutionResult, ExtractorInfo, ExtractorLoaderOptionDict, ExtractorResolvable, ExtractorSearchContext, ExtractorSession, ExtractorStreamable, FFMPEG_ARGS_PIPED, FFMPEG_ARGS_STRING, FFMPEG_SRATE_REGEX, FFmpegFilterer, FFmpegStreamOptions, FilterGraph, FiltersName, GuildNodeCreateOptions, GuildNodeInit, GuildNodeManager, GuildQueue, GuildQueueAFiltersCache, GuildQueueAudioFilters, GuildQueueEvent, GuildQueueEvents, GuildQueueHistory, GuildQueuePlayerNode, GuildQueueStatistics, GuildQueueStatisticsMetadata, HookDeclaration, HookDeclarationContext, IPBlock, IPRotationConfig, IPRotator, LrcGetParams, LrcGetResult, LrcLib, LrcSearchParams, LrcSearchResult, MetadataDispatch, NextFunction, NodeResolvable, OnAfterCreateStreamHandler, OnBeforeCreateStreamHandler, PlayOptions, Player, PlayerEvent, PlayerEvents, PlayerEventsEmitter, PlayerInitOptions, PlayerNodeInitializationResult, PlayerNodeInitializerOptions, PlayerProgressbarOptions, PlayerSearchResult, PlayerTimestamp, PlayerTriggeredReason, Playlist, PlaylistInitData, PlaylistJSON, PostProcessedResult, QueryCache, QueryCacheOptions, QueryCacheProvider, QueryCacheResolverContext, QueryExtractorSearch, QueryResolver, QueryType, QueueFilters, QueueRepeatMode, RawTrackData, RawTrackInit, RequestEntity, ResolvedQuery, ResourcePlayOptions, Runtime, RuntimeType, SearchOptions, SearchQueryType, SearchResult, SearchResultData, SequentialBucket, SerializedPlaylist, SerializedTrack, SerializedType, SetterFN$1 as SetterFN, SkipOptions, StreamConfig, StreamDispatcher, TimeData, TimelineDispatcherOptions, Track, TrackJSON, TrackLike, TrackResolvable, TrackSkipReason, TrackSource, TypeUtil, Util, VALIDATE_QUEUE_CAP, VoiceConnectConfig, VoiceEvents, VoiceReceiverNode, VoiceReceiverOptions, VoiceStateHandler, VoiceUtils, WithMetadata, createContext, createErisCompat, createFFmpegStream, createHook, decode, deserialize, encode, isErisProxy, onAfterCreateStream, onBeforeCreateStream, serialize, tryIntoThumbnailString, useContext, useHistory, useMainPlayer, useMasterPlayer, useMetadata, usePlayer, useQueue, useTimeline, useVolume, version };
|