distube 3.0.0-beta.8 → 3.0.2

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.
Files changed (158) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +64 -51
  3. package/dist/DisTube.d.ts +522 -0
  4. package/dist/DisTube.d.ts.map +1 -0
  5. package/dist/DisTube.js +794 -0
  6. package/dist/DisTube.js.map +1 -0
  7. package/dist/constant.d.ts +130 -0
  8. package/dist/constant.d.ts.map +1 -0
  9. package/dist/constant.js +150 -0
  10. package/dist/constant.js.map +1 -0
  11. package/dist/core/DisTubeBase.d.ts +55 -0
  12. package/dist/core/DisTubeBase.d.ts.map +1 -0
  13. package/dist/core/DisTubeBase.js +76 -0
  14. package/dist/core/DisTubeBase.js.map +1 -0
  15. package/dist/core/DisTubeHandler.d.ts +95 -0
  16. package/dist/core/DisTubeHandler.d.ts.map +1 -0
  17. package/dist/core/DisTubeHandler.js +337 -0
  18. package/dist/core/DisTubeHandler.js.map +1 -0
  19. package/dist/core/DisTubeOptions.d.ts +26 -0
  20. package/dist/core/DisTubeOptions.d.ts.map +1 -0
  21. package/dist/core/DisTubeOptions.js +93 -0
  22. package/dist/core/DisTubeOptions.js.map +1 -0
  23. package/dist/core/DisTubeStream.d.ts +52 -0
  24. package/dist/core/DisTubeStream.d.ts.map +1 -0
  25. package/dist/core/DisTubeStream.js +111 -0
  26. package/dist/core/DisTubeStream.js.map +1 -0
  27. package/dist/core/index.d.ts +7 -0
  28. package/dist/core/index.d.ts.map +1 -0
  29. package/dist/core/index.js +19 -0
  30. package/dist/core/index.js.map +1 -0
  31. package/dist/core/manager/BaseManager.d.ts +18 -0
  32. package/dist/core/manager/BaseManager.d.ts.map +1 -0
  33. package/dist/core/manager/BaseManager.js +44 -0
  34. package/dist/core/manager/BaseManager.js.map +1 -0
  35. package/dist/core/manager/QueueManager.d.ts +60 -0
  36. package/dist/core/manager/QueueManager.d.ts.map +1 -0
  37. package/dist/core/manager/QueueManager.js +202 -0
  38. package/dist/core/manager/QueueManager.js.map +1 -0
  39. package/dist/core/manager/index.d.ts +3 -0
  40. package/dist/core/manager/index.d.ts.map +1 -0
  41. package/dist/core/manager/index.js +15 -0
  42. package/dist/core/manager/index.js.map +1 -0
  43. package/dist/core/voice/DJSAdapter.d.ts +4 -0
  44. package/dist/core/voice/DJSAdapter.d.ts.map +1 -0
  45. package/dist/core/voice/DJSAdapter.js +61 -0
  46. package/dist/core/voice/DJSAdapter.js.map +1 -0
  47. package/dist/core/voice/DisTubeVoice.d.ts +85 -0
  48. package/dist/core/voice/DisTubeVoice.d.ts.map +1 -0
  49. package/dist/core/voice/DisTubeVoice.js +246 -0
  50. package/dist/core/voice/DisTubeVoice.js.map +1 -0
  51. package/dist/core/voice/DisTubeVoiceManager.d.ts +41 -0
  52. package/dist/core/voice/DisTubeVoiceManager.d.ts.map +1 -0
  53. package/dist/core/voice/DisTubeVoiceManager.js +67 -0
  54. package/dist/core/voice/DisTubeVoiceManager.js.map +1 -0
  55. package/dist/core/voice/index.d.ts +4 -0
  56. package/dist/core/voice/index.d.ts.map +1 -0
  57. package/dist/core/voice/index.js +16 -0
  58. package/dist/core/voice/index.js.map +1 -0
  59. package/dist/index.d.ts +8 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +23 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/plugin/http.d.ts +8 -0
  64. package/dist/plugin/http.d.ts.map +1 -0
  65. package/dist/plugin/http.js +20 -0
  66. package/dist/plugin/http.js.map +1 -0
  67. package/dist/plugin/https.d.ts +14 -0
  68. package/dist/plugin/https.d.ts.map +1 -0
  69. package/dist/plugin/https.js +50 -0
  70. package/dist/plugin/https.js.map +1 -0
  71. package/dist/plugin/index.d.ts +4 -0
  72. package/dist/plugin/index.d.ts.map +1 -0
  73. package/dist/plugin/index.js +16 -0
  74. package/dist/plugin/index.js.map +1 -0
  75. package/dist/plugin/youtube-dl.d.ts +11 -0
  76. package/dist/plugin/youtube-dl.d.ts.map +1 -0
  77. package/dist/plugin/youtube-dl.js +75 -0
  78. package/dist/plugin/youtube-dl.js.map +1 -0
  79. package/dist/struct/CustomPlugin.d.ts +27 -0
  80. package/dist/struct/CustomPlugin.d.ts.map +1 -0
  81. package/dist/struct/CustomPlugin.js +35 -0
  82. package/dist/struct/CustomPlugin.js.map +1 -0
  83. package/dist/struct/DisTubeError.d.ts +56 -0
  84. package/dist/struct/DisTubeError.d.ts.map +1 -0
  85. package/dist/struct/DisTubeError.js +75 -0
  86. package/dist/struct/DisTubeError.js.map +1 -0
  87. package/dist/struct/ExtractorPlugin.d.ts +29 -0
  88. package/dist/struct/ExtractorPlugin.d.ts.map +1 -0
  89. package/dist/struct/ExtractorPlugin.js +32 -0
  90. package/dist/struct/ExtractorPlugin.js.map +1 -0
  91. package/dist/struct/Playlist.d.ts +42 -0
  92. package/dist/struct/Playlist.d.ts.map +1 -0
  93. package/dist/struct/Playlist.js +104 -0
  94. package/dist/struct/Playlist.js.map +1 -0
  95. package/dist/struct/Plugin.d.ts +82 -0
  96. package/dist/struct/Plugin.d.ts.map +1 -0
  97. package/dist/struct/Plugin.js +108 -0
  98. package/dist/struct/Plugin.js.map +1 -0
  99. package/dist/struct/Queue.d.ts +217 -0
  100. package/dist/struct/Queue.d.ts.map +1 -0
  101. package/dist/struct/Queue.js +481 -0
  102. package/dist/struct/Queue.js.map +1 -0
  103. package/dist/struct/SearchResult.d.ts +28 -0
  104. package/dist/struct/SearchResult.d.ts.map +1 -0
  105. package/dist/struct/SearchResult.js +79 -0
  106. package/dist/struct/SearchResult.js.map +1 -0
  107. package/dist/struct/Song.d.ts +68 -0
  108. package/dist/struct/Song.d.ts.map +1 -0
  109. package/dist/struct/Song.js +229 -0
  110. package/dist/struct/Song.js.map +1 -0
  111. package/dist/struct/TaskQueue.d.ts +33 -0
  112. package/dist/struct/TaskQueue.d.ts.map +1 -0
  113. package/dist/struct/TaskQueue.js +58 -0
  114. package/dist/struct/TaskQueue.js.map +1 -0
  115. package/dist/struct/index.d.ts +10 -0
  116. package/dist/struct/index.d.ts.map +1 -0
  117. package/dist/struct/index.js +22 -0
  118. package/dist/struct/index.js.map +1 -0
  119. package/dist/tsconfig.tsbuildinfo +1 -0
  120. package/dist/type.d.ts +159 -0
  121. package/dist/type.d.ts.map +1 -0
  122. package/dist/type.js +3 -0
  123. package/dist/type.js.map +1 -0
  124. package/dist/util.d.ts +47 -0
  125. package/dist/util.d.ts.map +1 -0
  126. package/dist/util.js +205 -0
  127. package/dist/util.js.map +1 -0
  128. package/package.json +88 -62
  129. package/src/DisTube.js +0 -851
  130. package/src/DisTubeBase.js +0 -39
  131. package/src/DisTubeHandler.js +0 -440
  132. package/src/DisTubeOptions.js +0 -82
  133. package/src/Filter.js +0 -36
  134. package/src/Playlist.js +0 -75
  135. package/src/Plugin/CustomPlugin.js +0 -26
  136. package/src/Plugin/ExtractorPlugin.js +0 -25
  137. package/src/Plugin/Plugin.js +0 -36
  138. package/src/Plugin/http.js +0 -27
  139. package/src/Plugin/https.js +0 -27
  140. package/src/Queue.js +0 -340
  141. package/src/SearchResult.js +0 -57
  142. package/src/Song.js +0 -169
  143. package/src/util.js +0 -65
  144. package/typings/DisTube.d.ts +0 -518
  145. package/typings/DisTubeBase.d.ts +0 -31
  146. package/typings/DisTubeHandler.d.ts +0 -130
  147. package/typings/DisTubeOptions.d.ts +0 -5
  148. package/typings/Filter.d.ts +0 -83
  149. package/typings/Playlist.d.ts +0 -58
  150. package/typings/Plugin/CustomPlugin.d.ts +0 -21
  151. package/typings/Plugin/ExtractorPlugin.d.ts +0 -20
  152. package/typings/Plugin/Plugin.d.ts +0 -31
  153. package/typings/Plugin/http.d.ts +0 -4
  154. package/typings/Plugin/https.d.ts +0 -4
  155. package/typings/Queue.d.ts +0 -227
  156. package/typings/SearchResult.d.ts +0 -51
  157. package/typings/Song.d.ts +0 -153
  158. package/typings/util.d.ts +0 -6
@@ -1,130 +0,0 @@
1
- export = DisTubeHandler;
2
- /**
3
- * DisTube's Handler
4
- * @extends DisTubeBase
5
- * @private
6
- */
7
- declare class DisTubeHandler extends DisTubeBase {
8
- constructor(distube: any);
9
- ytdlOptions: any;
10
- /**
11
- * Emit error event
12
- * @param {Discord.TextChannel} channel Text channel where the error is encountered.
13
- * @param {Error} error error
14
- * @private
15
- */
16
- private emitError;
17
- /**
18
- * Delete a guild queue
19
- * @param {Discord.Snowflake|Discord.Message|Queue} queue A message from guild channel | Queue
20
- */
21
- deleteQueue(queue: Discord.Snowflake | Discord.Message | Queue): void;
22
- /**
23
- * @param {string} url url
24
- * @returns {Promise<ytdl.videoInfo>}
25
- */
26
- getYouTubeInfo(url: string): Promise<any>;
27
- /**
28
- * Resolve a Song
29
- * @param {Discord.Message|Discord.GuildMember} message A message from guild channel | A guild member
30
- * @param {string|Song|SearchResult|Playlist} song YouTube url | Search string | {@link Song}
31
- * @returns {Promise<Song|Array<Song>|Playlist>} Resolved Song
32
- */
33
- resolveSong(message: Discord.Message | Discord.GuildMember, song: string | Song | SearchResult | Playlist): Promise<Song | Array<Song> | Playlist>;
34
- /**
35
- * Resole Song[] or url to a Playlist
36
- * @param {Discord.Message|Discord.GuildMember} message A message from guild channel | A guild member
37
- * @param {Array<Song>|string} playlist Resolvable playlist
38
- * @returns {Promise<Playlist>}
39
- */
40
- resolvePlaylist(message: Discord.Message | Discord.GuildMember, playlist: Array<Song> | string): Promise<Playlist>;
41
- /**
42
- * Create a custom playlist
43
- * @returns {Promise<Playlist>}
44
- * @param {Discord.Message|Discord.GuildMember} message A message from guild channel | A guild member
45
- * @param {Array<string|Song|SearchResult>} songs Array of url, Song or SearchResult
46
- * @param {Object} [properties={}] Additional properties such as `name`
47
- * @param {boolean} [parallel=true] Whether or not fetch the songs in parallel
48
- */
49
- createCustomPlaylist(message: Discord.Message | Discord.GuildMember, songs: Array<string | Song | SearchResult>, properties?: any, parallel?: boolean): Promise<Playlist>;
50
- /**
51
- * Play / add a playlist
52
- * @returns {Promise<void>}
53
- * @param {Discord.Message|Discord.VoiceChannel|Discord.StageChannel} message A message from guild channel | a voice channel
54
- * @param {Playlist|string} playlist A YouTube playlist url | a Playlist
55
- * @param {boolean} [textChannel] The default text channel of the queue
56
- * @param {boolean} [skip=false] Skip the current song
57
- */
58
- handlePlaylist(message: Discord.Message | Discord.VoiceChannel | Discord.StageChannel, playlist: Playlist | string, textChannel?: boolean, skip?: boolean): Promise<void>;
59
- /**
60
- * Search for a song, fire {@link DisTube#event:error} if not found.
61
- * @param {Discord.Message} message A message from guild channel
62
- * @param {string} query The query string
63
- * @returns {Promise<Song?>} Song info
64
- */
65
- searchSong(message: Discord.Message, query: string): Promise<Song | null>;
66
- /**
67
- * Join the voice channel
68
- * @param {Queue} queue A message from guild channel
69
- * @param {Discord.VoiceChannel|Discord.StageChannel} voice The string search for
70
- * @param {boolean} retried retried?
71
- * @throws {Error}
72
- * @returns {Promise<Queue|true>} `true` if queue is not generated
73
- */
74
- joinVoiceChannel(queue: Queue, voice: Discord.VoiceChannel | Discord.StageChannel, retried?: boolean): Promise<Queue | true>;
75
- /**
76
- * Get related songs
77
- * @param {Song} song song
78
- * @returns {Array<ytdl.relatedVideo>} Related videos
79
- * @throws {NoRelated}
80
- */
81
- getRelatedVideo(song: Song): Array<any>;
82
- /**
83
- * Create a ytdl stream
84
- * @param {Queue} queue Queue
85
- * @returns {opus.Encoder}
86
- */
87
- createStream(queue: Queue): opus.Encoder;
88
- checkYouTubeInfo(song: any): Promise<void>;
89
- /**
90
- * Whether or not emit playSong event
91
- * @param {Queue} queue Queue
92
- * @private
93
- * @returns {boolean}
94
- */
95
- private _emitPlaySong;
96
- /**
97
- * Play a song on voice connection
98
- * @param {Queue} queue The guild queue
99
- * @returns {Promise<boolean>} error?
100
- */
101
- playSong(queue: Queue): Promise<boolean>;
102
- /**
103
- * Handle the queue when a Song finish
104
- * @private
105
- * @param {Queue} queue queue
106
- * @returns {Promise<void>}
107
- */
108
- private _handleSongFinish;
109
- /**
110
- * Handle error while playing
111
- * @private
112
- * @param {Queue} queue queue
113
- * @param {Error} error error
114
- */
115
- private _handlePlayingError;
116
- /**
117
- * Play a song from url without creating a {@link Queue}
118
- * @param {Discord.VoiceChannel|Discord.StageChannel} voiceChannel The voice channel will be joined
119
- * @param {string|Song|SearchResult} song YouTube url | {@link Song} | {@link SearchResult}
120
- * @returns {Promise<Discord.StreamDispatcher>}
121
- */
122
- playWithoutQueue(voiceChannel: Discord.VoiceChannel | Discord.StageChannel, song: string | Song | SearchResult): Promise<Discord.StreamDispatcher>;
123
- }
124
- import DisTubeBase = require("./DisTubeBase");
125
- import Discord = require("discord.js");
126
- import Queue = require("./Queue");
127
- import Song = require("./Song");
128
- import SearchResult = require("./SearchResult");
129
- import Playlist = require("./Playlist");
130
- import { opus } from "prism-media";
@@ -1,5 +0,0 @@
1
- export = DisTubeOptions;
2
- declare class DisTubeOptions {
3
- constructor(options: any);
4
- _validateOptions(options?: import("./DisTubeOptions")): void;
5
- }
@@ -1,83 +0,0 @@
1
- declare const _exports: {
2
- "3d": string;
3
- bassboost: string;
4
- echo: string;
5
- flanger: string;
6
- gate: string;
7
- haas: string;
8
- karaoke: string;
9
- nightcore: string;
10
- reverse: string;
11
- vaporwave: string;
12
- mcompand: string;
13
- phaser: string;
14
- tremolo: string;
15
- surround: string;
16
- earwax: string;
17
- };
18
- export = _exports;
19
- /**
20
- * Default DisTube audio filters.
21
- */
22
- export type DefaultFilters = {
23
- /**
24
- * 3d 3d
25
- */
26
- "": string;
27
- /**
28
- * bassboost
29
- */
30
- bassboost: string;
31
- /**
32
- * echo
33
- */
34
- echo: string;
35
- /**
36
- * karaoke
37
- */
38
- karaoke: string;
39
- /**
40
- * nightcore
41
- */
42
- nightcore: string;
43
- /**
44
- * vaporwave
45
- */
46
- vaporwave: string;
47
- /**
48
- * flanger
49
- */
50
- flanger: string;
51
- /**
52
- * gate
53
- */
54
- gate: string;
55
- /**
56
- * haas
57
- */
58
- haas: string;
59
- /**
60
- * reverse
61
- */
62
- reverse: string;
63
- /**
64
- * surround
65
- */
66
- surround: string;
67
- /**
68
- * mcompand
69
- */
70
- mcompand: string;
71
- /**
72
- * phaser
73
- */
74
- phaser: string;
75
- /**
76
- * tremolo
77
- */
78
- tremolo: string;
79
- /**
80
- * earwax
81
- */
82
- earwax: string;
83
- };
@@ -1,58 +0,0 @@
1
- export = Playlist;
2
- /** Class representing a playlist. */
3
- declare class Playlist {
4
- /**
5
- * Create a playlist
6
- * @param {Array<Song>|Object} playlist Playlist
7
- * @param {Discord.GuildMember} member Requested user
8
- * @param {Object} properties Custom properties
9
- */
10
- constructor(playlist: Array<Song> | any, member: Discord.GuildMember, properties?: any);
11
- /**
12
- * The source of the playlist
13
- * @type {string}
14
- */
15
- source: string;
16
- /**
17
- * User requested.
18
- * @type {Discord.GuildMember}
19
- */
20
- member: Discord.GuildMember;
21
- /**
22
- * User requested.
23
- * @type {Discord.User}
24
- */
25
- user: Discord.User;
26
- /**
27
- * Playlist songs.
28
- * @type {Array<Song>}
29
- */
30
- songs: Array<Song>;
31
- /**
32
- * Playlist name.
33
- * @type {string}
34
- */
35
- name: string;
36
- /**
37
- * Playlist URL.
38
- * @type {string}
39
- */
40
- url: string;
41
- /**
42
- * Playlist thumbnail.
43
- * @type {string}
44
- */
45
- thumbnail: string;
46
- /**
47
- * Playlist duration in second.
48
- * @type {number}
49
- */
50
- get duration(): number;
51
- /**
52
- * Formatted duration string `hh:mm:ss`.
53
- * @type {string}
54
- */
55
- get formattedDuration(): string;
56
- }
57
- import Discord = require("discord.js");
58
- import Song = require("./Song");
@@ -1,21 +0,0 @@
1
- export = CustomPlugin;
2
- /**
3
- * Custom Plugin
4
- * @extends Plugin
5
- */
6
- declare class CustomPlugin extends Plugin {
7
- /** Create a custom plugin */
8
- constructor();
9
- /**
10
- * Execute if the url is validated
11
- * @param {Discord.VoiceChannel|Discord.StageChannel} voiceChannel The voice channel will be joined
12
- * @param {string} url Validated url
13
- * @param {Discord.GuildMember} member Requested user
14
- * @param {Discord.TextChannel?} textChannel Default {@link Queue#textChannel}
15
- * @param {boolean} skip Skip the playing song (if exists)
16
- * @returns {Promise<void>}
17
- */
18
- play(voiceChannel: Discord.VoiceChannel | Discord.StageChannel, url: string, member: Discord.GuildMember, textChannel: Discord.TextChannel | null, skip: boolean): Promise<void>;
19
- }
20
- import Plugin = require("./Plugin");
21
- import Discord = require("discord.js");
@@ -1,20 +0,0 @@
1
- export = ExtractorPlugin;
2
- /**
3
- * Extractor Plugin
4
- * @extends Plugin
5
- */
6
- declare class ExtractorPlugin extends Plugin {
7
- /** Create a extractor plugin */
8
- constructor();
9
- /**
10
- * Execute if the url is validated
11
- * @param {string} url URL
12
- * @param {Discord.GuildMember} member Requested user
13
- * @returns {Promise<Song|Song[]|Playlist>}
14
- */
15
- resolve(url: string, member: Discord.GuildMember): Promise<Song | Song[] | Playlist>;
16
- }
17
- import Plugin = require("./Plugin");
18
- import Discord = require("discord.js");
19
- import Song = require("../Song");
20
- import Playlist = require("../Playlist");
@@ -1,31 +0,0 @@
1
- export = Plugin;
2
- /**
3
- * DisTube Plugin
4
- * @private
5
- */
6
- declare class Plugin {
7
- constructor(type: any);
8
- /**
9
- * Type of plugin (`"custom"` | `"extractor"`)
10
- * @type {string}
11
- */
12
- type: string;
13
- init(distube: any): void;
14
- /**
15
- * DisTube
16
- * @type {DisTube}
17
- */
18
- distube: DisTube;
19
- /**
20
- * Handler
21
- * @type {DisTubeHandler}
22
- */
23
- handler: any;
24
- /**
25
- * Check if the url is working with this plugin
26
- * @param {string} url Input url
27
- * @returns {Promise<boolean>}
28
- */
29
- validate(url: string): Promise<boolean>;
30
- }
31
- import DisTube = require("../DisTube");
@@ -1,4 +0,0 @@
1
- export = HTTPPlugin;
2
- declare const HTTPPlugin_base: typeof import("./ExtractorPlugin");
3
- declare class HTTPPlugin extends HTTPPlugin_base {
4
- }
@@ -1,4 +0,0 @@
1
- export = HTTPSPlugin;
2
- declare const HTTPSPlugin_base: typeof import("./ExtractorPlugin");
3
- declare class HTTPSPlugin extends HTTPSPlugin_base {
4
- }
@@ -1,227 +0,0 @@
1
- export = Queue;
2
- /**
3
- * Represents a queue.
4
- * @extends DisTubeBase
5
- */
6
- declare class Queue extends DisTubeBase {
7
- constructor(distube: any, message: any, song: any, textChannel?: any);
8
- /**
9
- * Queue id (Guild id)
10
- * @type {Discord.Snowflake}
11
- */
12
- id: Discord.Snowflake;
13
- /**
14
- * Stream dispatcher.
15
- * @type {Discord.StreamDispatcher?}
16
- */
17
- dispatcher: Discord.StreamDispatcher | null;
18
- /**
19
- * Voice connection.
20
- * @type {Discord.VoiceConnection?}
21
- */
22
- connection: Discord.VoiceConnection | null;
23
- /**
24
- * Stream volume. Default value: `50`.
25
- * @type {number}
26
- */
27
- volume: number;
28
- /**
29
- * List of songs in the queue (The first one is the playing song)
30
- * @type {Array<Song>}
31
- */
32
- songs: Array<Song>;
33
- /**
34
- * List of the previous songs.
35
- * @type {Array<Song>?}
36
- */
37
- previousSongs: Array<Song> | null;
38
- /**
39
- * Whether stream is currently stopped.
40
- * @type {boolean}
41
- * @private
42
- */
43
- private stopped;
44
- /**
45
- * Whether or not the last song was skipped to next song.
46
- * @type {boolean}
47
- * @private
48
- */
49
- private next;
50
- /**
51
- * Whether or not the last song was skipped to previous song.
52
- * @type {boolean}
53
- * @private
54
- */
55
- private prev;
56
- /**
57
- * Whether or not the stream is currently playing.
58
- * @type {boolean}
59
- */
60
- playing: boolean;
61
- /**
62
- * Whether or not the stream is currently paused.
63
- * @type {boolean}
64
- */
65
- paused: boolean;
66
- /**
67
- * Type of repeat mode (`0` is disabled, `1` is repeating a song, `2` is repeating all the queue).
68
- * Default value: `0` (disabled)
69
- * @type {number}
70
- */
71
- repeatMode: number;
72
- /**
73
- * Whether or not the autoplay mode is enabled.
74
- * Default value: `false`
75
- * @type {boolean}
76
- */
77
- autoplay: boolean;
78
- /**
79
- * Enabled audio filters.
80
- * Available filters: {@link Filters}
81
- * @type {Array<string>}
82
- */
83
- filters: Array<string>;
84
- /**
85
- * Should be an opus stream
86
- * @type {Readable?}
87
- * @private
88
- */
89
- private stream;
90
- /**
91
- * What time in the song to begin (in seconds).
92
- * @type {number}
93
- */
94
- beginTime: number;
95
- /**
96
- * The text channel of the Queue. (Default: where the first command is called).
97
- * @type {Discord.TextChannel?}
98
- */
99
- textChannel: Discord.TextChannel | null;
100
- /**
101
- * @type {DisTubeHandler}
102
- * @private
103
- */
104
- private handler;
105
- /**
106
- * Timeout for checking empty channel
107
- * @type {NodeJS.Timeout?}
108
- * @private
109
- */
110
- private emptyTimeout;
111
- /**
112
- * Formatted duration string.
113
- * @type {string}
114
- */
115
- get formattedDuration(): string;
116
- /**
117
- * Queue's duration.
118
- * @type {number}
119
- */
120
- get duration(): number;
121
- /**
122
- * What time in the song is playing (in seconds).
123
- * @type {number}
124
- */
125
- get currentTime(): number;
126
- /**
127
- * Formatted {@link Queue#currentTime} string.
128
- * @type {string}
129
- */
130
- get formattedCurrentTime(): string;
131
- /**
132
- * The voice channel playing in.
133
- * @type {Discord.VoiceChannel|Discord.StageChannel}
134
- */
135
- get voiceChannel(): Discord.VoiceChannel | Discord.StageChannel;
136
- /**
137
- * Add a Song or an array of Song to the queue
138
- * @param {Song|Array<Song>} song Song to add
139
- * @param {boolean} [unshift=false] Unshift?
140
- * @throws {Error}
141
- * @returns {Queue}
142
- */
143
- addToQueue(song: Song | Array<Song>, unshift?: boolean): Queue;
144
- /**
145
- * Pause the guild stream
146
- * @returns {Queue} The guild queue
147
- */
148
- pause(): Queue;
149
- /**
150
- * Resume the guild stream
151
- * @returns {Queue} The guild queue
152
- */
153
- resume(): Queue;
154
- /**
155
- * Stop the guild stream
156
- */
157
- stop(): void;
158
- /**
159
- * Set the guild stream's volume
160
- * @param {number} percent The percentage of volume you want to set
161
- * @returns {Queue} The guild queue
162
- */
163
- setVolume(percent: number): Queue;
164
- /**
165
- * Skip the playing song
166
- * @returns {Song} The song will skip to
167
- * @throws {Error}
168
- */
169
- skip(): Song;
170
- /**
171
- * Play the previous song
172
- * @returns {Song} The guild queue
173
- * @throws {Error}
174
- */
175
- previous(): Song;
176
- /**
177
- * Shuffle the queue's songs
178
- * @returns {Queue} The guild queue
179
- */
180
- shuffle(): Queue;
181
- /**
182
- * Jump to the song number in the queue.
183
- * The next one is 1, 2,...
184
- * The previous one is -1, -2,...
185
- * @param {number} num The song number to play
186
- * @returns {Queue} The guild queue
187
- * @throws {InvalidSong} if `num` is invalid number (0 < num < {@link Queue#songs}.length)
188
- */
189
- jump(num: number): Queue;
190
- /**
191
- * Set the repeat mode of the guild queue.
192
- * Turn off if repeat mode is the same value as new mode.
193
- * Toggle mode: `mode = null` `(0 -> 1 -> 2 -> 0...)`
194
- * @param {number?} [mode] The repeat modes `(0: disabled, 1: Repeat a song, 2: Repeat all the queue)`
195
- * @returns {number} The new repeat mode
196
- */
197
- setRepeatMode(mode?: number | null): number;
198
- /**
199
- * Enable or disable filter of the queue.
200
- * Available filters: {@link Filters}
201
- * @param {string|false} filter A filter name, `false` to clear all the filters
202
- * @returns {Array<string>} Enabled filters.
203
- * @throws {Error}
204
- */
205
- setFilter(filter: string | false): Array<string>;
206
- /**
207
- * Set the playing time to another position
208
- * @param {number} time Time in seconds
209
- * @returns {Queue}
210
- */
211
- seek(time: number): Queue;
212
- /**
213
- * Add a related song to the queue
214
- * @param {Song} [song] A song to get the related one
215
- * @returns {Promise<Queue>} The guild queue
216
- * @throws {Error}
217
- */
218
- addRelatedVideo(song?: Song): Promise<Queue>;
219
- /**
220
- * Toggle autoplay mode
221
- * @returns {boolean} Autoplay mode state
222
- */
223
- toggleAutoplay(): boolean;
224
- }
225
- import DisTubeBase = require("./DisTubeBase");
226
- import Discord = require("discord.js");
227
- import Song = require("./Song");
@@ -1,51 +0,0 @@
1
- export = SearchResult;
2
- /** Class representing a search result. */
3
- declare class SearchResult {
4
- constructor(info: any);
5
- source: string;
6
- /**
7
- * Type of SearchResult (video or playlist)
8
- * @type {string}
9
- */
10
- type: string;
11
- /**
12
- * YouTube video or playlist id
13
- * @type {string}
14
- */
15
- id: string;
16
- /**
17
- * Video or playlist title.
18
- * @type {string}
19
- */
20
- name: string;
21
- /**
22
- * Video or playlist URL.
23
- * @type {string}
24
- */
25
- url: string;
26
- /**
27
- * Video / Playlist views count
28
- * @type {number}
29
- */
30
- views: number;
31
- /**
32
- * Indicates if the video is an active live.
33
- * @type {boolean?}
34
- */
35
- isLive: boolean | null;
36
- /**
37
- * Video duration.
38
- * @type {number}
39
- */
40
- duration: number;
41
- /**
42
- * Formatted duration string `hh:mm:ss` or `mm:ss`.
43
- * @type {string}
44
- */
45
- formattedDuration: string;
46
- /**
47
- * Video thumbnail.
48
- * @type {string?}
49
- */
50
- thumbnail: string | null;
51
- }