distube 3.0.0-beta.35 → 3.0.0-beta.39
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 +4 -3
- package/dist/DisTube.d.ts +78 -57
- package/dist/DisTube.d.ts.map +1 -1
- package/dist/DisTube.js +87 -87
- package/dist/DisTube.js.map +1 -1
- package/dist/constant.d.ts +43 -10
- package/dist/constant.d.ts.map +1 -1
- package/dist/constant.js +45 -11
- package/dist/constant.js.map +1 -1
- package/dist/core/DisTubeBase.d.ts +7 -13
- package/dist/core/DisTubeBase.d.ts.map +1 -1
- package/dist/core/DisTubeBase.js +4 -9
- package/dist/core/DisTubeBase.js.map +1 -1
- package/dist/core/DisTubeHandler.d.ts +9 -4
- package/dist/core/DisTubeHandler.d.ts.map +1 -1
- package/dist/core/DisTubeHandler.js +56 -10
- package/dist/core/DisTubeHandler.js.map +1 -1
- package/dist/core/DisTubeOptions.d.ts +0 -18
- package/dist/core/DisTubeOptions.d.ts.map +1 -1
- package/dist/core/DisTubeOptions.js +4 -1
- package/dist/core/DisTubeOptions.js.map +1 -1
- package/dist/core/DisTubeStream.d.ts +5 -2
- package/dist/core/DisTubeStream.d.ts.map +1 -1
- package/dist/core/DisTubeStream.js +23 -21
- package/dist/core/DisTubeStream.js.map +1 -1
- package/dist/core/manager/BaseManager.d.ts +2 -3
- package/dist/core/manager/BaseManager.d.ts.map +1 -1
- package/dist/core/manager/BaseManager.js +3 -3
- package/dist/core/manager/BaseManager.js.map +1 -1
- package/dist/core/manager/QueueManager.d.ts +2 -2
- package/dist/core/manager/QueueManager.d.ts.map +1 -1
- package/dist/core/manager/QueueManager.js +25 -22
- package/dist/core/manager/QueueManager.js.map +1 -1
- package/dist/core/voice/DisTubeVoice.d.ts +15 -15
- package/dist/core/voice/DisTubeVoice.d.ts.map +1 -1
- package/dist/core/voice/DisTubeVoice.js +27 -16
- package/dist/core/voice/DisTubeVoice.js.map +1 -1
- package/dist/core/voice/DisTubeVoiceManager.js +1 -1
- package/dist/core/voice/DisTubeVoiceManager.js.map +1 -1
- package/dist/plugin/http.js +2 -2
- package/dist/plugin/http.js.map +1 -1
- package/dist/plugin/https.js +3 -3
- package/dist/plugin/https.js.map +1 -1
- package/dist/plugin/youtube-dl.js +3 -3
- package/dist/plugin/youtube-dl.js.map +1 -1
- package/dist/struct/CustomPlugin.d.ts +17 -14
- package/dist/struct/CustomPlugin.d.ts.map +1 -1
- package/dist/struct/CustomPlugin.js +16 -16
- package/dist/struct/CustomPlugin.js.map +1 -1
- package/dist/struct/DisTubeError.d.ts +12 -3
- package/dist/struct/DisTubeError.d.ts.map +1 -1
- package/dist/struct/DisTubeError.js +11 -12
- package/dist/struct/DisTubeError.js.map +1 -1
- package/dist/struct/ExtractorPlugin.d.ts +16 -8
- package/dist/struct/ExtractorPlugin.d.ts.map +1 -1
- package/dist/struct/ExtractorPlugin.js +13 -12
- package/dist/struct/ExtractorPlugin.js.map +1 -1
- package/dist/struct/Playlist.d.ts +2 -3
- package/dist/struct/Playlist.d.ts.map +1 -1
- package/dist/struct/Playlist.js +9 -6
- package/dist/struct/Playlist.js.map +1 -1
- package/dist/struct/Plugin.d.ts +62 -9
- package/dist/struct/Plugin.d.ts.map +1 -1
- package/dist/struct/Plugin.js +73 -14
- package/dist/struct/Plugin.js.map +1 -1
- package/dist/struct/Queue.d.ts +17 -15
- package/dist/struct/Queue.d.ts.map +1 -1
- package/dist/struct/Queue.js +31 -16
- package/dist/struct/Queue.js.map +1 -1
- package/dist/struct/SearchResult.js +2 -2
- package/dist/struct/SearchResult.js.map +1 -1
- package/dist/struct/Song.d.ts +6 -8
- package/dist/struct/Song.d.ts.map +1 -1
- package/dist/struct/Song.js +17 -15
- package/dist/struct/Song.js.map +1 -1
- package/dist/struct/__mocks__/Queue.d.ts +12 -0
- package/dist/struct/__mocks__/Queue.d.ts.map +1 -0
- package/dist/struct/__mocks__/Queue.js +22 -0
- package/dist/struct/__mocks__/Queue.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/type.d.ts +76 -20
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +16 -7
- package/dist/util.js.map +1 -1
- package/package.json +30 -28
package/README.md
CHANGED
|
@@ -39,10 +39,11 @@ npm install distube@beta
|
|
|
39
39
|
### Requirement
|
|
40
40
|
|
|
41
41
|
- Node v12 or higher
|
|
42
|
+
- [git](https://git-scm.com/downloads) _(For installing forked dependencies)_
|
|
42
43
|
- [discord.js](https://discord.js.org) v12 or **v13 _(Recommended)_**
|
|
43
|
-
- [@discordjs/voice](https://github.com/discordjs/voice)
|
|
44
|
+
- [@discordjs/voice](https://github.com/discordjs/voice)
|
|
44
45
|
- [FFmpeg](https://www.ffmpeg.org/download.html)
|
|
45
|
-
- [@discordjs/opus](https://github.com/discordjs/opus)
|
|
46
|
+
- [@discordjs/opus](https://github.com/discordjs/opus)
|
|
46
47
|
- [sodium](https://www.npmjs.com/package/sodium) or [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers)
|
|
47
48
|
- [python](https://www.python.org/) _(Optional - For [`youtube-dl`](https://youtube-dl.org/) to support [700+ more sites](https://ytdl-org.github.io/youtube-dl/supportedsites.html).)_
|
|
48
49
|
|
|
@@ -61,4 +62,4 @@ Read DisTube's definitions, properties and events details in the [Documentation
|
|
|
61
62
|
- [node-ytdl-core](https://github.com/fent/node-ytdl-core): YouTube scraper ([DisTube Fork](https://github.com/distubejs/node-ytdl-core))
|
|
62
63
|
- [node-ytsr](https://github.com/TimeForANinja/node-ytsr): YouTube search scraper ([DisTube Fork](https://github.com/distubejs/ytsr))
|
|
63
64
|
- [node-ytpl](https://github.com/TimeForANinja/node-ytpl): YouTube playlist resolver ([DisTube Fork](https://github.com/distubejs/ytpl))
|
|
64
|
-
- [youtube-dl-exec](https://github.com/microlinkhq/youtube-dl-exec): [`youtube-dl`](https://youtube-dl.org/) wrapper
|
|
65
|
+
- [youtube-dl-exec](https://github.com/microlinkhq/youtube-dl-exec): [`youtube-dl`](https://youtube-dl.org/) wrapper
|
package/dist/DisTube.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import { EventEmitter } from "events";
|
|
1
|
+
import { TypedEmitter } from "tiny-typed-emitter";
|
|
3
2
|
import { DisTubeHandler, DisTubeVoiceManager, Options, Playlist, Queue, QueueManager, SearchResult } from ".";
|
|
4
3
|
import type { Client, GuildMember, Message, StageChannel, TextChannel, VoiceChannel } from "discord.js";
|
|
5
|
-
import type { CustomPlugin, DisTubeOptions, ExtractorPlugin, Filters, GuildIDResolvable, Song } from ".";
|
|
6
|
-
|
|
4
|
+
import type { CustomPlugin, DisTubeEvents, DisTubeOptions, ExtractorPlugin, Filters, GuildIDResolvable, Song } from ".";
|
|
5
|
+
/**
|
|
6
|
+
* DisTube class
|
|
7
|
+
* @extends EventEmitter
|
|
8
|
+
*/
|
|
9
|
+
export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
7
10
|
handler: DisTubeHandler;
|
|
8
11
|
options: Options;
|
|
9
12
|
client: Client;
|
|
@@ -12,22 +15,9 @@ export declare interface DisTube {
|
|
|
12
15
|
extractorPlugins: ExtractorPlugin[];
|
|
13
16
|
customPlugins: CustomPlugin[];
|
|
14
17
|
filters: Filters;
|
|
15
|
-
on(event: "addList", listener: (queue: Queue, playlist: Playlist) => void): this;
|
|
16
|
-
on(event: "addSong" | "playSong" | "finishSong", listener: (queue: Queue, song: Song) => void): this;
|
|
17
|
-
on(event: "empty" | "finish" | "initQueue" | "noRelated" | "disconnect" | "deleteQueue", listener: (queue: Queue) => void): this;
|
|
18
|
-
on(event: "error", listener: (channel: TextChannel, error: Error) => void): this;
|
|
19
|
-
on(event: "searchNoResult" | "searchCancel", listener: (message: Message, query: string) => void): this;
|
|
20
|
-
on(event: "searchResult", listener: (message: Message, results: SearchResult[], query: string) => void): this;
|
|
21
|
-
on(event: "searchInvalidAnswer" | "searchDone", listener: (message: Message, answer: Message, query: string) => void): this;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* DisTube class
|
|
25
|
-
* @extends EventEmitter
|
|
26
|
-
*/
|
|
27
|
-
export declare class DisTube extends EventEmitter {
|
|
28
18
|
/**
|
|
29
19
|
* Create a new DisTube class.
|
|
30
|
-
* @param {Discord.Client} client JS client
|
|
20
|
+
* @param {Discord.Client} client Discord.JS client
|
|
31
21
|
* @param {DisTubeOptions} [otp] Custom DisTube options
|
|
32
22
|
* @example
|
|
33
23
|
* const Discord = require('discord.js'),
|
|
@@ -43,10 +33,12 @@ export declare class DisTube extends EventEmitter {
|
|
|
43
33
|
* Shorthand method for {@link DisTube#playVoiceChannel}
|
|
44
34
|
* @returns {Promise<void>}
|
|
45
35
|
* @param {Discord.Message} message A message from guild channel
|
|
46
|
-
* @param {string|Song|SearchResult|Playlist} song
|
|
36
|
+
* @param {string|Song|SearchResult|Playlist} song URL | Search string |
|
|
37
|
+
* {@link Song} | {@link SearchResult} | {@link Playlist}
|
|
47
38
|
* @param {Object} [options] Optional options
|
|
48
39
|
* @param {boolean} [options.skip=false] Skip the playing song (if exists) and play the added song/playlist instantly
|
|
49
|
-
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
40
|
+
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
41
|
+
* (after the playing song if exists)
|
|
50
42
|
* @example
|
|
51
43
|
* client.on('message', (message) => {
|
|
52
44
|
* if (!message.content.startsWith(config.prefix)) return;
|
|
@@ -65,10 +57,12 @@ export declare class DisTube extends EventEmitter {
|
|
|
65
57
|
* Emit {@link DisTube#addList}, {@link DisTube#addSong} or {@link DisTube#playSong} after executing
|
|
66
58
|
* @returns {Promise<void>}
|
|
67
59
|
* @param {Discord.VoiceChannel|Discord.StageChannel} voiceChannel The voice channel will be joined
|
|
68
|
-
* @param {string|Song|SearchResult|Playlist} song
|
|
60
|
+
* @param {string|Song|SearchResult|Playlist} song URL | Search string |
|
|
61
|
+
* {@link Song} | {@link SearchResult} | {@link Playlist}
|
|
69
62
|
* @param {Object} [options] Optional options
|
|
70
63
|
* @param {boolean} [options.skip=false] Skip the playing song (if exists) and play the added song/playlist instantly
|
|
71
|
-
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
64
|
+
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
65
|
+
* (after the playing song if exists)
|
|
72
66
|
* @param {Discord.GuildMember} [options.member] Requested user (default is your bot)
|
|
73
67
|
* @param {Discord.TextChannel} [options.textChannel] Default {@link Queue#textChannel} (if the queue wasn't created)
|
|
74
68
|
* @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)
|
|
@@ -81,6 +75,11 @@ export declare class DisTube extends EventEmitter {
|
|
|
81
75
|
message?: Message;
|
|
82
76
|
}): Promise<void>;
|
|
83
77
|
/**
|
|
78
|
+
* <info>Shorthand method of {@link DisTubeHandler#createCustomPlaylist} and {@link DisTube#playVoiceChannel}
|
|
79
|
+
*
|
|
80
|
+
* If you doesn't have a user message (interaction,...),
|
|
81
|
+
* see {@link DisTubeHandler#createCustomPlaylist} example</info>
|
|
82
|
+
*
|
|
84
83
|
* Play or add array of video urls.
|
|
85
84
|
* {@link DisTube#event:playSong} or {@link DisTube#event:addList} will be emitted
|
|
86
85
|
* with `playlist`'s properties include `properties` parameter's properties such as
|
|
@@ -91,10 +90,11 @@ export declare class DisTube extends EventEmitter {
|
|
|
91
90
|
* @param {Object} [properties={}] Additional properties such as `name`
|
|
92
91
|
* @param {Object} [options] Optional options
|
|
93
92
|
* @param {boolean} [options.skip=false] Skip the playing song (if exists) and play the added song/playlist instantly
|
|
94
|
-
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
93
|
+
* @param {boolean} [options.unshift=false] Add the song/playlist to the beginning of the queue
|
|
94
|
+
* (after the playing song if exists)
|
|
95
95
|
* @param {boolean} [options.parallel=true] Whether or not fetch the songs in parallel
|
|
96
96
|
* @example
|
|
97
|
-
*
|
|
97
|
+
* const songs = ["https://www.youtube.com/watch?v=xxx", "https://www.youtube.com/watch?v=yyy"];
|
|
98
98
|
* distube.playCustomPlaylist(message, songs, { name: "My playlist name" });
|
|
99
99
|
* // Fetching custom playlist sequentially (reduce lag for low specs)
|
|
100
100
|
* distube.playCustomPlaylist(message, songs, { name: "My playlist name" }, false, false);
|
|
@@ -107,7 +107,7 @@ export declare class DisTube extends EventEmitter {
|
|
|
107
107
|
/**
|
|
108
108
|
* Search for a song.
|
|
109
109
|
* You can customize how user answers instead of send a number.
|
|
110
|
-
* Then use {@link DisTube#play} or {@link DisTube#
|
|
110
|
+
* Then use {@link DisTube#play} or {@link DisTube#playVoiceChannel} to play it.
|
|
111
111
|
* @param {string} string The string search for
|
|
112
112
|
* @param {Object} options Search options
|
|
113
113
|
* @param {number} [options.limit=10] Limit the results
|
|
@@ -189,7 +189,9 @@ export declare class DisTube extends EventEmitter {
|
|
|
189
189
|
*/
|
|
190
190
|
setVolume(queue: GuildIDResolvable, percent: number): Queue;
|
|
191
191
|
/**
|
|
192
|
-
* Skip the playing song
|
|
192
|
+
* Skip the playing song if there is a next song in the queue.
|
|
193
|
+
* <info>If {@link Queue#autoplay} is `true` and there is no up next song,
|
|
194
|
+
* DisTube will add and play a related song.</info>
|
|
193
195
|
* @param {GuildIDResolvable} queue The type can be resolved to give a {@link Queue}
|
|
194
196
|
* @returns {Promise<Song>} The new Song will be played
|
|
195
197
|
* @throws {Error}
|
|
@@ -252,12 +254,11 @@ export declare class DisTube extends EventEmitter {
|
|
|
252
254
|
*/
|
|
253
255
|
jump(queue: GuildIDResolvable, num: number): Promise<Queue>;
|
|
254
256
|
/**
|
|
255
|
-
* Set the repeat mode of the guild queue
|
|
256
|
-
*
|
|
257
|
-
* Toggle mode `(0 -> 1 -> 2 -> 0...)`: `mode` is `undefined`
|
|
257
|
+
* Set the repeat mode of the guild queue.\
|
|
258
|
+
* Toggle mode `(Disabled -> Song -> Queue -> Disabled ->...)` if `mode` is `undefined`
|
|
258
259
|
* @param {GuildIDResolvable} queue The type can be resolved to give a {@link Queue}
|
|
259
|
-
* @param {
|
|
260
|
-
* @returns {
|
|
260
|
+
* @param {RepeatMode?} [mode] The repeat modes (toggle if `undefined`)
|
|
261
|
+
* @returns {RepeatMode} The new repeat mode
|
|
261
262
|
* @example
|
|
262
263
|
* client.on('message', (message) => {
|
|
263
264
|
* if (!message.content.startsWith(config.prefix)) return;
|
|
@@ -269,6 +270,21 @@ export declare class DisTube extends EventEmitter {
|
|
|
269
270
|
* message.channel.send("Set repeat mode to `" + mode + "`");
|
|
270
271
|
* }
|
|
271
272
|
* });
|
|
273
|
+
* @example
|
|
274
|
+
* const { RepeatMode } = require("distube");
|
|
275
|
+
* let mode;
|
|
276
|
+
* switch(distube.setRepeatMode(message, parseInt(args[0]))) {
|
|
277
|
+
* case RepeatMode.DISABLED:
|
|
278
|
+
* mode = "Off";
|
|
279
|
+
* break;
|
|
280
|
+
* case RepeatMode.SONG:
|
|
281
|
+
* mode = "Repeat a song";
|
|
282
|
+
* break;
|
|
283
|
+
* case RepeatMode.QUEUE:
|
|
284
|
+
* mode = "Repeat all queue";
|
|
285
|
+
* break;
|
|
286
|
+
* }
|
|
287
|
+
* message.channel.send("Set repeat mode to `" + mode + "`");
|
|
272
288
|
*/
|
|
273
289
|
setRepeatMode(queue: GuildIDResolvable, mode?: number): number;
|
|
274
290
|
/**
|
|
@@ -282,7 +298,7 @@ export declare class DisTube extends EventEmitter {
|
|
|
282
298
|
* const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
|
|
283
299
|
* const command = args.shift();
|
|
284
300
|
* if (command == "autoplay") {
|
|
285
|
-
*
|
|
301
|
+
* const mode = distube.toggleAutoplay(message);
|
|
286
302
|
* message.channel.send("Set autoplay mode to `" + (mode ? "On" : "Off") + "`");
|
|
287
303
|
* }
|
|
288
304
|
* });
|
|
@@ -307,7 +323,7 @@ export declare class DisTube extends EventEmitter {
|
|
|
307
323
|
* const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
|
|
308
324
|
* const command = args.shift();
|
|
309
325
|
* if ([`3d`, `bassboost`, `echo`, `karaoke`, `nightcore`, `vaporwave`].includes(command)) {
|
|
310
|
-
*
|
|
326
|
+
* const filter = distube.setFilter(message, command);
|
|
311
327
|
* message.channel.send("Current queue filter: " + (filter.join(", ") || "Off"));
|
|
312
328
|
* }
|
|
313
329
|
* });
|
|
@@ -338,7 +354,7 @@ export declare class DisTube extends EventEmitter {
|
|
|
338
354
|
}
|
|
339
355
|
export default DisTube;
|
|
340
356
|
/**
|
|
341
|
-
* Emitted after DisTube add a new playlist to the playing {@link Queue}
|
|
357
|
+
* Emitted after DisTube add a new playlist to the playing {@link Queue}.
|
|
342
358
|
*
|
|
343
359
|
* @event DisTube#addList
|
|
344
360
|
* @param {Queue} queue The guild queue
|
|
@@ -349,7 +365,7 @@ export default DisTube;
|
|
|
349
365
|
* ));
|
|
350
366
|
*/
|
|
351
367
|
/**
|
|
352
|
-
*
|
|
368
|
+
* Emitted after DisTube add a new song to the playing {@link Queue}.
|
|
353
369
|
*
|
|
354
370
|
* @event DisTube#addSong
|
|
355
371
|
* @param {Queue} queue The guild queue
|
|
@@ -360,16 +376,18 @@ export default DisTube;
|
|
|
360
376
|
* ));
|
|
361
377
|
*/
|
|
362
378
|
/**
|
|
363
|
-
* Emitted when there is no user in the voice channel,
|
|
364
|
-
*
|
|
379
|
+
* Emitted when there is no user in the voice channel,
|
|
380
|
+
* {@link DisTubeOptions}.leaveOnEmpty is `true` and there is a playing queue.
|
|
365
381
|
*
|
|
382
|
+
* If there is no playing queue (stopped and {@link DisTubeOptions}.leaveOnStop is `false`),
|
|
383
|
+
* it will leave the channel without emitting this event.
|
|
366
384
|
* @event DisTube#empty
|
|
367
385
|
* @param {Queue} queue The guild queue
|
|
368
386
|
* @example
|
|
369
387
|
* distube.on("empty", queue => queue.textChannel.send("Channel is empty. Leaving the channel"))
|
|
370
388
|
*/
|
|
371
389
|
/**
|
|
372
|
-
* Emitted when
|
|
390
|
+
* Emitted when DisTube encounters an error.
|
|
373
391
|
*
|
|
374
392
|
* @event DisTube#error
|
|
375
393
|
* @param {Discord.TextChannel} channel Text channel where the error is encountered.
|
|
@@ -381,7 +399,7 @@ export default DisTube;
|
|
|
381
399
|
*/
|
|
382
400
|
/**
|
|
383
401
|
* Emitted when there is no more song in the queue and {@link Queue#autoplay} is `false`.
|
|
384
|
-
* DisTube will leave voice channel if {@link DisTubeOptions}.leaveOnFinish is `true
|
|
402
|
+
* DisTube will leave voice channel if {@link DisTubeOptions}.leaveOnFinish is `true`.
|
|
385
403
|
*
|
|
386
404
|
* @event DisTube#finish
|
|
387
405
|
* @param {Queue} queue The guild queue
|
|
@@ -400,8 +418,8 @@ export default DisTube;
|
|
|
400
418
|
* });
|
|
401
419
|
*/
|
|
402
420
|
/**
|
|
403
|
-
* Emitted when {@link Queue#autoplay} is `true`,
|
|
404
|
-
* DisTube cannot find related songs to play
|
|
421
|
+
* Emitted when {@link Queue#autoplay} is `true`, {@link Queue#songs} is empty,
|
|
422
|
+
* and DisTube cannot find related songs to play.
|
|
405
423
|
*
|
|
406
424
|
* @event DisTube#noRelated
|
|
407
425
|
* @param {Queue} queue The guild queue
|
|
@@ -410,19 +428,20 @@ export default DisTube;
|
|
|
410
428
|
*/
|
|
411
429
|
/**
|
|
412
430
|
* Emitted when DisTube play a song.
|
|
413
|
-
*
|
|
431
|
+
*
|
|
432
|
+
* If {@link DisTubeOptions}.emitNewSongOnly is `true`,
|
|
433
|
+
* this event is not emitted when looping a song or next song is the previous one.
|
|
414
434
|
*
|
|
415
435
|
* @event DisTube#playSong
|
|
416
436
|
* @param {Queue} queue The guild queue
|
|
417
437
|
* @param {Song} song Playing song
|
|
418
438
|
* @example
|
|
419
|
-
* const status = (queue) => `Volume: \`${queue.volume}%\` | Loop: \`${queue.repeatMode ? queue.repeatMode == 2 ? "Server Queue" : "This Song" : "Off"}\` | Autoplay: \`${queue.autoplay ? "On" : "Off"}\``;
|
|
420
439
|
* distube.on("playSong", (queue, song) => queue.textChannel.send(
|
|
421
|
-
* `Playing \`${song.name}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}
|
|
440
|
+
* `Playing \`${song.name}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}`
|
|
422
441
|
* ));
|
|
423
442
|
*/
|
|
424
443
|
/**
|
|
425
|
-
* Emitted when DisTube cannot find any results for the query
|
|
444
|
+
* Emitted when DisTube cannot find any results for the query.
|
|
426
445
|
*
|
|
427
446
|
* @event DisTube#searchNoResult
|
|
428
447
|
* @param {Discord.Message} message The user message called play method
|
|
@@ -431,9 +450,9 @@ export default DisTube;
|
|
|
431
450
|
* distube.on("searchNoResult", (message, query) => message.channel.send(`No result found for ${query}!`));
|
|
432
451
|
*/
|
|
433
452
|
/**
|
|
434
|
-
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0
|
|
435
|
-
* and song param of {@link DisTube#
|
|
436
|
-
* DisTube will wait for user's next message to choose song manually.
|
|
453
|
+
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,
|
|
454
|
+
* and song param of {@link DisTube#playVoiceChannel} is invalid url.
|
|
455
|
+
* DisTube will wait for user's next message to choose a song manually.
|
|
437
456
|
* <info>{@link https://support.google.com/youtube/answer/7354993|Safe search} is enabled
|
|
438
457
|
* if {@link DisTubeOptions}.nsfw is disabled and the message's channel is not a nsfw channel.</info>
|
|
439
458
|
*
|
|
@@ -444,12 +463,14 @@ export default DisTube;
|
|
|
444
463
|
* @example
|
|
445
464
|
* // DisTubeOptions.searchSongs > 0
|
|
446
465
|
* distube.on("searchResult", (message, results) => {
|
|
447
|
-
* message.channel.send(`**Choose an option from below**\n${
|
|
466
|
+
* message.channel.send(`**Choose an option from below**\n${
|
|
467
|
+
* results.map((song, i) => `**${i + 1}**. ${song.name} - \`${song.formattedDuration}\``).join("\n")
|
|
468
|
+
* }\n*Enter anything else or wait 60 seconds to cancel*`);
|
|
448
469
|
* });
|
|
449
470
|
*/
|
|
450
471
|
/**
|
|
451
|
-
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0
|
|
452
|
-
* and the search canceled due to {@link DisTubeOptions|DisTubeOptions.searchTimeout}
|
|
472
|
+
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,
|
|
473
|
+
* and the search canceled due to {@link DisTubeOptions|DisTubeOptions.searchTimeout}.
|
|
453
474
|
*
|
|
454
475
|
* @event DisTube#searchCancel
|
|
455
476
|
* @param {Discord.Message} message The user message called play method
|
|
@@ -459,8 +480,8 @@ export default DisTube;
|
|
|
459
480
|
* distube.on("searchCancel", (message) => message.channel.send(`Searching canceled`));
|
|
460
481
|
*/
|
|
461
482
|
/**
|
|
462
|
-
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0
|
|
463
|
-
* and the search canceled due to user's next message is not a number or out of results range
|
|
483
|
+
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,
|
|
484
|
+
* and the search canceled due to user's next message is not a number or out of results range.
|
|
464
485
|
*
|
|
465
486
|
* @event DisTube#searchInvalidAnswer
|
|
466
487
|
* @param {Discord.Message} message The user message called play method
|
|
@@ -471,8 +492,8 @@ export default DisTube;
|
|
|
471
492
|
* distube.on("searchInvalidAnswer", (message) => message.channel.send(`You answered an invalid number!`));
|
|
472
493
|
*/
|
|
473
494
|
/**
|
|
474
|
-
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0
|
|
475
|
-
* and after the user chose a search result to play
|
|
495
|
+
* Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,
|
|
496
|
+
* and after the user chose a search result to play.
|
|
476
497
|
*
|
|
477
498
|
* @event DisTube#searchDone
|
|
478
499
|
* @param {Discord.Message} message The user message called play method
|
|
@@ -480,7 +501,7 @@ export default DisTube;
|
|
|
480
501
|
* @param {string} query The search query
|
|
481
502
|
*/
|
|
482
503
|
/**
|
|
483
|
-
* Emitted when the bot is disconnected to
|
|
504
|
+
* Emitted when the bot is disconnected to a voice channel.
|
|
484
505
|
*
|
|
485
506
|
* @event DisTube#disconnect
|
|
486
507
|
* @param {Queue} queue The guild queue
|
|
@@ -492,7 +513,7 @@ export default DisTube;
|
|
|
492
513
|
* @param {Queue} queue The guild queue
|
|
493
514
|
*/
|
|
494
515
|
/**
|
|
495
|
-
* Emitted when DisTube finished a song
|
|
516
|
+
* Emitted when DisTube finished a song.
|
|
496
517
|
*
|
|
497
518
|
* @event DisTube#finishSong
|
|
498
519
|
* @param {Queue} queue The guild queue
|
package/dist/DisTube.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisTube.d.ts","sourceRoot":"","sources":["../src/DisTube.ts"],"names":[],"mappings":"
|
|
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,EAOb,MAAM,GAAG,CAAC;AACX,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AAExH;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,YAAY,CAAC,aAAa,CAAC;IACtD,OAAO,EAAE,cAAc,CAAC;IACxB,OAA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