distube 3.0.7 → 3.2.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/dist/DisTube.d.ts +133 -65
- package/dist/DisTube.d.ts.map +1 -1
- package/dist/DisTube.js +161 -103
- package/dist/DisTube.js.map +1 -1
- package/dist/constant.d.ts +14 -15
- package/dist/constant.d.ts.map +1 -1
- package/dist/constant.js +14 -15
- package/dist/constant.js.map +1 -1
- package/dist/core/DisTubeBase.d.ts +3 -4
- package/dist/core/DisTubeBase.d.ts.map +1 -1
- package/dist/core/DisTubeBase.js +1 -2
- package/dist/core/DisTubeBase.js.map +1 -1
- package/dist/core/DisTubeHandler.d.ts +37 -25
- package/dist/core/DisTubeHandler.d.ts.map +1 -1
- package/dist/core/DisTubeHandler.js +72 -68
- package/dist/core/DisTubeHandler.js.map +1 -1
- package/dist/core/DisTubeOptions.d.ts +1 -2
- package/dist/core/DisTubeOptions.d.ts.map +1 -1
- package/dist/core/DisTubeOptions.js +64 -58
- package/dist/core/DisTubeOptions.js.map +1 -1
- package/dist/core/DisTubeStream.d.ts +1 -1
- package/dist/core/DisTubeStream.d.ts.map +1 -1
- package/dist/core/DisTubeStream.js +0 -1
- package/dist/core/DisTubeStream.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/manager/BaseManager.d.ts +11 -7
- package/dist/core/manager/BaseManager.d.ts.map +1 -1
- package/dist/core/manager/BaseManager.js +11 -13
- package/dist/core/manager/BaseManager.js.map +1 -1
- package/dist/core/manager/QueueManager.d.ts +11 -38
- package/dist/core/manager/QueueManager.d.ts.map +1 -1
- package/dist/core/manager/QueueManager.js +115 -129
- package/dist/core/manager/QueueManager.js.map +1 -1
- package/dist/core/voice/DJSAdapter.js +4 -7
- package/dist/core/voice/DJSAdapter.js.map +1 -1
- package/dist/core/voice/DisTubeVoice.d.ts +10 -13
- package/dist/core/voice/DisTubeVoice.d.ts.map +1 -1
- package/dist/core/voice/DisTubeVoice.js +39 -28
- package/dist/core/voice/DisTubeVoice.js.map +1 -1
- package/dist/core/voice/DisTubeVoiceManager.d.ts +10 -10
- package/dist/core/voice/DisTubeVoiceManager.d.ts.map +1 -1
- package/dist/core/voice/DisTubeVoiceManager.js +6 -6
- package/dist/core/voice/DisTubeVoiceManager.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin/http.d.ts +5 -3
- package/dist/plugin/http.d.ts.map +1 -1
- package/dist/plugin/http.js +3 -5
- package/dist/plugin/http.js.map +1 -1
- package/dist/plugin/https.d.ts +10 -5
- package/dist/plugin/https.d.ts.map +1 -1
- package/dist/plugin/https.js +6 -9
- package/dist/plugin/https.js.map +1 -1
- package/dist/plugin/youtube-dl.d.ts +5 -4
- package/dist/plugin/youtube-dl.d.ts.map +1 -1
- package/dist/plugin/youtube-dl.js +6 -11
- package/dist/plugin/youtube-dl.js.map +1 -1
- package/dist/struct/CustomPlugin.d.ts +37 -17
- package/dist/struct/CustomPlugin.d.ts.map +1 -1
- package/dist/struct/CustomPlugin.js +18 -19
- package/dist/struct/CustomPlugin.js.map +1 -1
- package/dist/struct/DisTubeError.d.ts +4 -3
- package/dist/struct/DisTubeError.d.ts.map +1 -1
- package/dist/struct/DisTubeError.js +5 -7
- package/dist/struct/DisTubeError.js.map +1 -1
- package/dist/struct/ExtractorPlugin.d.ts +25 -15
- package/dist/struct/ExtractorPlugin.d.ts.map +1 -1
- package/dist/struct/ExtractorPlugin.js +14 -16
- package/dist/struct/ExtractorPlugin.js.map +1 -1
- package/dist/struct/Playlist.d.ts +24 -8
- package/dist/struct/Playlist.d.ts.map +1 -1
- package/dist/struct/Playlist.js +27 -14
- package/dist/struct/Playlist.js.map +1 -1
- package/dist/struct/Plugin.d.ts +4 -12
- package/dist/struct/Plugin.d.ts.map +1 -1
- package/dist/struct/Plugin.js +1 -11
- package/dist/struct/Plugin.js.map +1 -1
- package/dist/struct/Queue.d.ts +5 -6
- package/dist/struct/Queue.d.ts.map +1 -1
- package/dist/struct/Queue.js +5 -9
- package/dist/struct/Queue.js.map +1 -1
- package/dist/struct/SearchResult.d.ts +0 -1
- package/dist/struct/SearchResult.d.ts.map +1 -1
- package/dist/struct/SearchResult.js +2 -4
- package/dist/struct/SearchResult.js.map +1 -1
- package/dist/struct/Song.d.ts +26 -10
- package/dist/struct/Song.d.ts.map +1 -1
- package/dist/struct/Song.js +37 -25
- package/dist/struct/Song.js.map +1 -1
- package/dist/struct/TaskQueue.d.ts +1 -6
- package/dist/struct/TaskQueue.d.ts.map +1 -1
- package/dist/struct/TaskQueue.js +13 -7
- package/dist/struct/TaskQueue.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/type.d.ts +12 -12
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/dist/util.d.ts +7 -6
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +23 -24
- package/dist/util.js.map +1 -1
- package/package.json +7 -8
package/dist/DisTube.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { TypedEmitter } from "tiny-typed-emitter";
|
|
2
|
-
import { DisTubeHandler, DisTubeVoiceManager, Options, Playlist, Queue, QueueManager, SearchResult } from ".";
|
|
3
|
-
import type { Client, GuildMember,
|
|
4
|
-
import type { CustomPlugin, DisTubeEvents, DisTubeOptions, ExtractorPlugin, Filters,
|
|
2
|
+
import { DisTubeHandler, DisTubeVoiceManager, Options, Playlist, Queue, QueueManager, SearchResult, Song } from ".";
|
|
3
|
+
import type { Client, GuildMember, GuildTextBasedChannel, Message, VoiceBasedChannel } from "discord.js";
|
|
4
|
+
import type { CustomPlugin, DisTubeEvents, DisTubeOptions, ExtractorPlugin, Filters, GuildIdResolvable } from ".";
|
|
5
|
+
export declare const version: string;
|
|
5
6
|
/**
|
|
6
7
|
* DisTube class
|
|
7
8
|
* @extends EventEmitter
|
|
8
9
|
*/
|
|
9
10
|
export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
10
|
-
handler: DisTubeHandler;
|
|
11
|
-
options: Options;
|
|
12
|
-
client: Client;
|
|
13
|
-
queues: QueueManager;
|
|
14
|
-
voices: DisTubeVoiceManager;
|
|
15
|
-
extractorPlugins: ExtractorPlugin[];
|
|
16
|
-
customPlugins: CustomPlugin[];
|
|
17
|
-
filters: Filters;
|
|
11
|
+
readonly handler: DisTubeHandler;
|
|
12
|
+
readonly options: Options;
|
|
13
|
+
readonly client: Client;
|
|
14
|
+
readonly queues: QueueManager;
|
|
15
|
+
readonly voices: DisTubeVoiceManager;
|
|
16
|
+
readonly extractorPlugins: ExtractorPlugin[];
|
|
17
|
+
readonly customPlugins: CustomPlugin[];
|
|
18
|
+
readonly filters: Filters;
|
|
18
19
|
/**
|
|
19
20
|
* Create a new DisTube class.
|
|
20
21
|
* @param {Discord.Client} client Discord.JS client
|
|
@@ -29,34 +30,75 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
29
30
|
* client.login("Your Discord Bot Token")
|
|
30
31
|
*/
|
|
31
32
|
constructor(client: Client, otp?: DisTubeOptions);
|
|
33
|
+
static get version(): string;
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @
|
|
35
|
-
|
|
35
|
+
* DisTube version
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
get version(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Play / add a song or playlist from url. Search and play a song if it is not a valid url.
|
|
41
|
+
*
|
|
42
|
+
* @param {Discord.BaseGuildVoiceChannel} voiceChannel The voice channel will be joined
|
|
36
43
|
* @param {string|Song|SearchResult|Playlist} song URL | Search string |
|
|
37
44
|
* {@link Song} | {@link SearchResult} | {@link Playlist}
|
|
38
45
|
* @param {Object} [options] Optional options
|
|
39
46
|
* @param {boolean} [options.skip=false] Skip the playing song (if exists) and play the added song/playlist instantly
|
|
40
47
|
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
41
48
|
* (after the playing song if exists)
|
|
49
|
+
* @param {Discord.GuildMember} [options.member] Requested user (default is your bot)
|
|
50
|
+
* @param {Discord.BaseGuildTextChannel} [options.textChannel] Default {@link Queue#textChannel}
|
|
51
|
+
* @param {Discord.Message} [options.message] Called message (For built-in search events. If this is a {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy|falsy value}, it will play the first result instead)
|
|
52
|
+
* @param {*} [options.metadata] Optional metadata that can be attached to the song/playlist will be played,
|
|
53
|
+
* This is useful for identification purposes when the song/playlist is passed around in events.
|
|
54
|
+
* See {@link Song#metadata} or {@link Playlist#metadata}
|
|
42
55
|
* @example
|
|
43
56
|
* client.on('message', (message) => {
|
|
44
57
|
* if (!message.content.startsWith(config.prefix)) return;
|
|
45
58
|
* const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
|
|
46
59
|
* const command = args.shift();
|
|
47
60
|
* if (command == "play")
|
|
48
|
-
* distube.play(message, args.join(" ")
|
|
61
|
+
* distube.play(message.member.voice?.channel, args.join(" "), {
|
|
62
|
+
* member: message.member,
|
|
63
|
+
* textChannel: message.channel,
|
|
64
|
+
* message
|
|
65
|
+
* });
|
|
49
66
|
* });
|
|
67
|
+
* @returns {Promise<void>}
|
|
50
68
|
*/
|
|
51
|
-
play(
|
|
69
|
+
play(voiceChannel: VoiceBasedChannel, song: string | Song | SearchResult | Playlist | null, options?: {
|
|
52
70
|
skip?: boolean;
|
|
53
71
|
unshift?: boolean;
|
|
72
|
+
member?: GuildMember;
|
|
73
|
+
textChannel?: GuildTextBasedChannel;
|
|
74
|
+
message?: Message;
|
|
75
|
+
metadata?: any;
|
|
54
76
|
}): Promise<void>;
|
|
55
77
|
/**
|
|
56
78
|
* Play / add a song or playlist from url. Search and play a song if it is not a valid url.
|
|
57
|
-
*
|
|
79
|
+
*
|
|
80
|
+
* @param {Discord.Message} message A message from guild channel
|
|
81
|
+
* @param {string|Song|SearchResult|Playlist} song URL | Search string |
|
|
82
|
+
* {@link Song} | {@link SearchResult} | {@link Playlist}
|
|
83
|
+
* @param {Object} [options] Optional options
|
|
84
|
+
* @param {boolean} [options.skip=false] Skip the playing song (if exists) and play the added song/playlist instantly
|
|
85
|
+
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
86
|
+
* (after the playing song if exists)
|
|
87
|
+
* @param {*} [options.metadata] Optional metadata that can be attached to the song/playlist will be played,
|
|
88
|
+
* This is useful for identification purposes when the song/playlist is passed around in events.
|
|
89
|
+
* See {@link Song#metadata} or {@link Playlist#metadata}
|
|
90
|
+
* @deprecated Message parameter is deprecated, use VoiceChannel instead. See {@link DisTube#play}
|
|
91
|
+
*/
|
|
92
|
+
play(message: Message<true>, song: string | Song | SearchResult | Playlist, options?: {
|
|
93
|
+
skip?: boolean;
|
|
94
|
+
unshift?: boolean;
|
|
95
|
+
metadata?: any;
|
|
96
|
+
}): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Play / add a song or playlist from url. Search and play a song if it is not a valid url.
|
|
99
|
+
*
|
|
58
100
|
* @returns {Promise<void>}
|
|
59
|
-
* @param {Discord.
|
|
101
|
+
* @param {Discord.BaseGuildVoiceChannel} voiceChannel The voice channel will be joined
|
|
60
102
|
* @param {string|Song|SearchResult|Playlist} song URL | Search string |
|
|
61
103
|
* {@link Song} | {@link SearchResult} | {@link Playlist}
|
|
62
104
|
* @param {Object} [options] Optional options
|
|
@@ -64,21 +106,50 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
64
106
|
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
65
107
|
* (after the playing song if exists)
|
|
66
108
|
* @param {Discord.GuildMember} [options.member] Requested user (default is your bot)
|
|
67
|
-
* @param {Discord.
|
|
109
|
+
* @param {Discord.BaseGuildTextChannel} [options.textChannel] Default {@link Queue#textChannel}
|
|
68
110
|
* @param {Discord.Message} [options.message] Called message (For built-in search events. If this is a {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy|falsy value}, it will play the first result instead)
|
|
111
|
+
* @param {*} [options.metadata] Optional metadata that can be attached to the song/playlist will be played,
|
|
112
|
+
* This is useful for identification purposes when the song/playlist is passed around in events.
|
|
113
|
+
* See {@link Song#metadata} or {@link Playlist#metadata}
|
|
114
|
+
* @deprecated Use {@link DisTube#play} instead
|
|
69
115
|
*/
|
|
70
|
-
playVoiceChannel(voiceChannel:
|
|
116
|
+
playVoiceChannel(voiceChannel: VoiceBasedChannel, song: string | Song | SearchResult | Playlist | null, options?: {
|
|
71
117
|
skip?: boolean;
|
|
72
118
|
unshift?: boolean;
|
|
73
119
|
member?: GuildMember;
|
|
74
|
-
textChannel?:
|
|
120
|
+
textChannel?: GuildTextBasedChannel;
|
|
75
121
|
message?: Message;
|
|
122
|
+
metadata?: any;
|
|
76
123
|
}): Promise<void>;
|
|
77
124
|
/**
|
|
78
|
-
*
|
|
125
|
+
* Create a custom playlist
|
|
126
|
+
* @returns {Promise<Playlist>}
|
|
127
|
+
* @param {Array<string|Song|SearchResult>} songs Array of url, Song or SearchResult
|
|
128
|
+
* @param {Object} [options] Optional options
|
|
129
|
+
* @param {Discord.GuildMember} [options.message] A message from guild channel | A guild member
|
|
130
|
+
* @param {Object} [options.properties={}] Additional properties such as `name`
|
|
131
|
+
* @param {boolean} [options.parallel=true] Whether or not fetch the songs in parallel
|
|
132
|
+
* @param {*} [options.metadata] Metadata
|
|
133
|
+
* @example
|
|
134
|
+
* const songs = ["https://www.youtube.com/watch?v=xxx", "https://www.youtube.com/watch?v=yyy"];
|
|
135
|
+
* const playlist = await distube.createCustomPlaylist(songs, {
|
|
136
|
+
* member: message.member,
|
|
137
|
+
* properties: { name: "My playlist name" },
|
|
138
|
+
* parallel: true
|
|
139
|
+
* });
|
|
140
|
+
* distube.play(voiceChannel, playlist, { ... });
|
|
141
|
+
*/
|
|
142
|
+
createCustomPlaylist(songs: (string | Song | SearchResult)[], options?: {
|
|
143
|
+
member?: GuildMember;
|
|
144
|
+
properties?: Record<string, any>;
|
|
145
|
+
parallel?: boolean;
|
|
146
|
+
metadata?: any;
|
|
147
|
+
}): Promise<Playlist>;
|
|
148
|
+
/**
|
|
149
|
+
* <info>Shorthand method of {@link DisTube#createCustomPlaylist} and {@link DisTube#play}
|
|
79
150
|
*
|
|
80
151
|
* If you doesn't have a user message (interaction,...),
|
|
81
|
-
* see {@link
|
|
152
|
+
* see {@link DisTube#createCustomPlaylist} example</info>
|
|
82
153
|
*
|
|
83
154
|
* Play or add array of video urls.
|
|
84
155
|
* {@link DisTube#event:playSong} or {@link DisTube#event:addList} will be emitted
|
|
@@ -87,27 +158,24 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
87
158
|
* @returns {Promise<void>}
|
|
88
159
|
* @param {Discord.Message} message A message from guild channel
|
|
89
160
|
* @param {Array<string|Song|SearchResult>} songs Array of url, Song or SearchResult
|
|
90
|
-
* @param {Object} [properties={}] Additional properties such as `name`
|
|
161
|
+
* @param {Object} [properties={}] Additional properties for playlist such as `name`
|
|
91
162
|
* @param {Object} [options] Optional options
|
|
92
163
|
* @param {boolean} [options.skip=false] Skip the playing song (if exists) and play the added song/playlist instantly
|
|
93
164
|
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
94
165
|
* (after the playing song if exists)
|
|
95
166
|
* @param {boolean} [options.parallel=true] Whether or not fetch the songs in parallel
|
|
96
|
-
* @
|
|
97
|
-
* const songs = ["https://www.youtube.com/watch?v=xxx", "https://www.youtube.com/watch?v=yyy"];
|
|
98
|
-
* distube.playCustomPlaylist(message, songs, { name: "My playlist name" });
|
|
99
|
-
* // Fetching custom playlist sequentially (reduce lag for low specs)
|
|
100
|
-
* distube.playCustomPlaylist(message, songs, { name: "My playlist name" }, false, false);
|
|
167
|
+
* @deprecated Use {@link DisTube#createCustomPlaylist} and {@link DisTube#play} instead
|
|
101
168
|
*/
|
|
102
|
-
playCustomPlaylist(message: Message
|
|
169
|
+
playCustomPlaylist(message: Message<true>, songs: Array<string | Song | SearchResult>, properties?: Record<string, any>, options?: {
|
|
103
170
|
skip?: boolean;
|
|
104
171
|
unshift?: boolean;
|
|
105
172
|
parallel?: boolean;
|
|
173
|
+
metadata?: any;
|
|
106
174
|
}): Promise<void>;
|
|
107
175
|
/**
|
|
108
|
-
* Search for a song.
|
|
109
|
-
*
|
|
110
|
-
*
|
|
176
|
+
* Search for a song. You can customize how user answers instead of send a number.
|
|
177
|
+
* Then use {@link DisTube#play} to play it.
|
|
178
|
+
*
|
|
111
179
|
* @param {string} string The string search for
|
|
112
180
|
* @param {Object} options Search options
|
|
113
181
|
* @param {number} [options.limit=10] Limit the results
|
|
@@ -124,7 +192,7 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
124
192
|
}): Promise<Array<SearchResult>>;
|
|
125
193
|
/**
|
|
126
194
|
* Get the guild queue
|
|
127
|
-
* @param {
|
|
195
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
128
196
|
* @returns {Queue?}
|
|
129
197
|
* @throws {Error}
|
|
130
198
|
* @example
|
|
@@ -140,24 +208,24 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
140
208
|
* }
|
|
141
209
|
* });
|
|
142
210
|
*/
|
|
143
|
-
getQueue(queue:
|
|
211
|
+
getQueue(queue: GuildIdResolvable): Queue | undefined;
|
|
144
212
|
/**
|
|
145
213
|
* Pause the guild stream
|
|
146
|
-
* @param {
|
|
214
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
147
215
|
* @returns {Queue} The guild queue
|
|
148
216
|
* @throws {Error}
|
|
149
217
|
*/
|
|
150
|
-
pause(queue:
|
|
218
|
+
pause(queue: GuildIdResolvable): Queue;
|
|
151
219
|
/**
|
|
152
220
|
* Resume the guild stream
|
|
153
|
-
* @param {
|
|
221
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
154
222
|
* @returns {Queue} The guild queue
|
|
155
223
|
* @throws {Error}
|
|
156
224
|
*/
|
|
157
|
-
resume(queue:
|
|
225
|
+
resume(queue: GuildIdResolvable): Queue;
|
|
158
226
|
/**
|
|
159
227
|
* Stop the guild stream
|
|
160
|
-
* @param {
|
|
228
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
161
229
|
* @returns {Promise<void>}
|
|
162
230
|
* @throws {Error}
|
|
163
231
|
* @example
|
|
@@ -171,10 +239,10 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
171
239
|
* }
|
|
172
240
|
* });
|
|
173
241
|
*/
|
|
174
|
-
stop(queue:
|
|
242
|
+
stop(queue: GuildIdResolvable): Promise<void>;
|
|
175
243
|
/**
|
|
176
244
|
* Set the guild stream's volume
|
|
177
|
-
* @param {
|
|
245
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
178
246
|
* @param {number} percent The percentage of volume you want to set
|
|
179
247
|
* @returns {Queue} The guild queue
|
|
180
248
|
* @throws {Error}
|
|
@@ -187,12 +255,12 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
187
255
|
* distube.setVolume(message, Number(args[0]));
|
|
188
256
|
* });
|
|
189
257
|
*/
|
|
190
|
-
setVolume(queue:
|
|
258
|
+
setVolume(queue: GuildIdResolvable, percent: number): Queue;
|
|
191
259
|
/**
|
|
192
260
|
* Skip the playing song if there is a next song in the queue.
|
|
193
261
|
* <info>If {@link Queue#autoplay} is `true` and there is no up next song,
|
|
194
262
|
* DisTube will add and play a related song.</info>
|
|
195
|
-
* @param {
|
|
263
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
196
264
|
* @returns {Promise<Song>} The new Song will be played
|
|
197
265
|
* @throws {Error}
|
|
198
266
|
* @example
|
|
@@ -204,10 +272,10 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
204
272
|
* distube.skip(message);
|
|
205
273
|
* });
|
|
206
274
|
*/
|
|
207
|
-
skip(queue:
|
|
275
|
+
skip(queue: GuildIdResolvable): Promise<Song>;
|
|
208
276
|
/**
|
|
209
277
|
* Play the previous song
|
|
210
|
-
* @param {
|
|
278
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
211
279
|
* @returns {Promise<Song>} The new Song will be played
|
|
212
280
|
* @throws {Error}
|
|
213
281
|
* @example
|
|
@@ -219,10 +287,10 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
219
287
|
* distube.previous(message);
|
|
220
288
|
* });
|
|
221
289
|
*/
|
|
222
|
-
previous(queue:
|
|
290
|
+
previous(queue: GuildIdResolvable): Promise<Song>;
|
|
223
291
|
/**
|
|
224
292
|
* Shuffle the guild queue songs
|
|
225
|
-
* @param {
|
|
293
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
226
294
|
* @returns {Promise<Queue>} The guild queue
|
|
227
295
|
* @example
|
|
228
296
|
* client.on('message', (message) => {
|
|
@@ -233,12 +301,12 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
233
301
|
* distube.shuffle(message);
|
|
234
302
|
* });
|
|
235
303
|
*/
|
|
236
|
-
shuffle(queue:
|
|
304
|
+
shuffle(queue: GuildIdResolvable): Promise<Queue>;
|
|
237
305
|
/**
|
|
238
306
|
* Jump to the song number in the queue.
|
|
239
307
|
* The next one is 1, 2,...
|
|
240
308
|
* The previous one is -1, -2,...
|
|
241
|
-
* @param {
|
|
309
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
242
310
|
* @param {number} num The song number to play
|
|
243
311
|
* @returns {Promise<Queue>} The guild queue
|
|
244
312
|
* @throws {Error} if `num` is invalid number (0 < num < {@link Queue#songs}.length)
|
|
@@ -252,11 +320,11 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
252
320
|
* .catch(err => message.channel.send("Invalid song number."));
|
|
253
321
|
* });
|
|
254
322
|
*/
|
|
255
|
-
jump(queue:
|
|
323
|
+
jump(queue: GuildIdResolvable, num: number): Promise<Queue>;
|
|
256
324
|
/**
|
|
257
325
|
* Set the repeat mode of the guild queue.\
|
|
258
326
|
* Toggle mode `(Disabled -> Song -> Queue -> Disabled ->...)` if `mode` is `undefined`
|
|
259
|
-
* @param {
|
|
327
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
260
328
|
* @param {RepeatMode?} [mode] The repeat modes (toggle if `undefined`)
|
|
261
329
|
* @returns {RepeatMode} The new repeat mode
|
|
262
330
|
* @example
|
|
@@ -286,10 +354,10 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
286
354
|
* }
|
|
287
355
|
* message.channel.send("Set repeat mode to `" + mode + "`");
|
|
288
356
|
*/
|
|
289
|
-
setRepeatMode(queue:
|
|
357
|
+
setRepeatMode(queue: GuildIdResolvable, mode?: number): number;
|
|
290
358
|
/**
|
|
291
359
|
* Toggle autoplay mode
|
|
292
|
-
* @param {
|
|
360
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
293
361
|
* @returns {boolean} Autoplay mode state
|
|
294
362
|
* @throws {Error}
|
|
295
363
|
* @example
|
|
@@ -303,17 +371,17 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
303
371
|
* }
|
|
304
372
|
* });
|
|
305
373
|
*/
|
|
306
|
-
toggleAutoplay(queue:
|
|
374
|
+
toggleAutoplay(queue: GuildIdResolvable): boolean;
|
|
307
375
|
/**
|
|
308
376
|
* Add related song to the queue
|
|
309
|
-
* @param {
|
|
377
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
310
378
|
* @returns {Promise<Song>} The guild queue
|
|
311
379
|
*/
|
|
312
|
-
addRelatedSong(queue:
|
|
380
|
+
addRelatedSong(queue: GuildIdResolvable): Promise<Song>;
|
|
313
381
|
/**
|
|
314
382
|
* Enable or disable filter(s) of the queue.
|
|
315
383
|
* Available filters: {@link Filters}
|
|
316
|
-
* @param {
|
|
384
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
317
385
|
* @param {string|false} filter A filter name, `false` to clear all the filters
|
|
318
386
|
* @param {boolean} [force=false] Force enable the input filter(s) even if it's enabled
|
|
319
387
|
* @returns {Array<string>} Enabled filters.
|
|
@@ -328,10 +396,10 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
328
396
|
* }
|
|
329
397
|
* });
|
|
330
398
|
*/
|
|
331
|
-
setFilter(queue:
|
|
399
|
+
setFilter(queue: GuildIdResolvable, filter: string | false, force?: boolean): Array<string>;
|
|
332
400
|
/**
|
|
333
401
|
* Set the playing time to another position
|
|
334
|
-
* @param {
|
|
402
|
+
* @param {GuildIdResolvable} queue The type can be resolved to give a {@link Queue}
|
|
335
403
|
* @param {number} time Time in seconds
|
|
336
404
|
* @returns {Queue} Seeked queue
|
|
337
405
|
* @example
|
|
@@ -343,14 +411,14 @@ export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
|
343
411
|
* distube.seek(message, Number(args[0]));
|
|
344
412
|
* });
|
|
345
413
|
*/
|
|
346
|
-
seek(queue:
|
|
414
|
+
seek(queue: GuildIdResolvable, time: number): Queue;
|
|
347
415
|
/**
|
|
348
416
|
* Emit error event
|
|
349
417
|
* @param {Error} error error
|
|
350
|
-
* @param {Discord.
|
|
418
|
+
* @param {Discord.BaseGuildTextChannel} [channel] Text channel where the error is encountered.
|
|
351
419
|
* @private
|
|
352
420
|
*/
|
|
353
|
-
emitError(error: Error, channel?:
|
|
421
|
+
emitError(error: Error, channel?: GuildTextBasedChannel): void;
|
|
354
422
|
}
|
|
355
423
|
export default DisTube;
|
|
356
424
|
/**
|
|
@@ -390,7 +458,7 @@ export default DisTube;
|
|
|
390
458
|
* Emitted when DisTube encounters an error.
|
|
391
459
|
*
|
|
392
460
|
* @event DisTube#error
|
|
393
|
-
* @param {Discord.
|
|
461
|
+
* @param {Discord.BaseGuildTextChannel} channel Text channel where the error is encountered.
|
|
394
462
|
* @param {Error} error The error encountered
|
|
395
463
|
* @example
|
|
396
464
|
* distube.on("error", (channel, error) => channel.send(
|
|
@@ -451,7 +519,7 @@ export default DisTube;
|
|
|
451
519
|
*/
|
|
452
520
|
/**
|
|
453
521
|
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,
|
|
454
|
-
* and song param of {@link DisTube#
|
|
522
|
+
* and song param of {@link DisTube#play} is invalid url.
|
|
455
523
|
* DisTube will wait for user's next message to choose a song manually.
|
|
456
524
|
* <info>{@link https://support.google.com/youtube/answer/7354993|Safe search} is enabled
|
|
457
525
|
* if {@link DisTubeOptions}.nsfw is disabled and the message's channel is not a nsfw channel.</info>
|
package/dist/DisTube.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisTube.d.ts","sourceRoot":"","sources":["../src/DisTube.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEL,cAAc,EACd,mBAAmB,EAGnB,OAAO,EACP,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,YAAY,
|
|
1
|
+
{"version":3,"file":"DisTube.d.ts","sourceRoot":"","sources":["../src/DisTube.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAEL,cAAc,EACd,mBAAmB,EAGnB,OAAO,EACP,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,IAAI,EAQL,MAAM,GAAG,CAAC;AACX,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAe,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACtH,OAAO,KAAK,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