distube 4.0.0-dev.2 → 4.0.0-dev.5
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 +1 -1
- package/dist/index.d.ts +604 -8
- package/dist/index.js +2437 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2375 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +72 -45
- package/dist/DisTube.d.ts +0 -54
- package/dist/DisTube.d.ts.map +0 -1
- package/dist/DisTube.js +0 -279
- package/dist/DisTube.js.map +0 -1
- package/dist/constant.d.ts +0 -27
- package/dist/constant.d.ts.map +0 -1
- package/dist/constant.js +0 -47
- package/dist/constant.js.map +0 -1
- package/dist/core/DisTubeBase.d.ts +0 -14
- package/dist/core/DisTubeBase.d.ts.map +0 -1
- package/dist/core/DisTubeBase.js +0 -31
- package/dist/core/DisTubeBase.js.map +0 -1
- package/dist/core/DisTubeHandler.d.ts +0 -27
- package/dist/core/DisTubeHandler.d.ts.map +0 -1
- package/dist/core/DisTubeHandler.js +0 -230
- package/dist/core/DisTubeHandler.js.map +0 -1
- package/dist/core/DisTubeOptions.d.ts +0 -23
- package/dist/core/DisTubeOptions.d.ts.map +0 -1
- package/dist/core/DisTubeOptions.js +0 -90
- package/dist/core/DisTubeOptions.js.map +0 -1
- package/dist/core/DisTubeStream.d.ts +0 -19
- package/dist/core/DisTubeStream.d.ts.map +0 -1
- package/dist/core/DisTubeStream.js +0 -72
- package/dist/core/DisTubeStream.js.map +0 -1
- package/dist/core/index.d.ts +0 -7
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -19
- package/dist/core/index.js.map +0 -1
- package/dist/core/manager/BaseManager.d.ts +0 -7
- package/dist/core/manager/BaseManager.d.ts.map +0 -1
- package/dist/core/manager/BaseManager.js +0 -16
- package/dist/core/manager/BaseManager.js.map +0 -1
- package/dist/core/manager/FilterManager.d.ts +0 -16
- package/dist/core/manager/FilterManager.d.ts.map +0 -1
- package/dist/core/manager/FilterManager.js +0 -88
- package/dist/core/manager/FilterManager.js.map +0 -1
- package/dist/core/manager/GuildIdManager.d.ts +0 -9
- package/dist/core/manager/GuildIdManager.d.ts.map +0 -1
- package/dist/core/manager/GuildIdManager.js +0 -25
- package/dist/core/manager/GuildIdManager.js.map +0 -1
- package/dist/core/manager/QueueManager.d.ts +0 -11
- package/dist/core/manager/QueueManager.d.ts.map +0 -1
- package/dist/core/manager/QueueManager.js +0 -172
- package/dist/core/manager/QueueManager.js.map +0 -1
- package/dist/core/manager/index.d.ts +0 -5
- package/dist/core/manager/index.d.ts.map +0 -1
- package/dist/core/manager/index.js +0 -17
- package/dist/core/manager/index.js.map +0 -1
- package/dist/core/voice/DisTubeVoice.d.ts +0 -32
- package/dist/core/voice/DisTubeVoice.d.ts.map +0 -1
- package/dist/core/voice/DisTubeVoice.js +0 -190
- package/dist/core/voice/DisTubeVoice.js.map +0 -1
- package/dist/core/voice/DisTubeVoiceManager.d.ts +0 -10
- package/dist/core/voice/DisTubeVoiceManager.d.ts.map +0 -1
- package/dist/core/voice/DisTubeVoiceManager.js +0 -36
- package/dist/core/voice/DisTubeVoiceManager.js.map +0 -1
- package/dist/core/voice/index.d.ts +0 -3
- package/dist/core/voice/index.d.ts.map +0 -1
- package/dist/core/voice/index.js +0 -15
- package/dist/core/voice/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugin/http.d.ts +0 -10
- package/dist/plugin/http.d.ts.map +0 -1
- package/dist/plugin/http.js +0 -18
- package/dist/plugin/http.js.map +0 -1
- package/dist/plugin/https.d.ts +0 -19
- package/dist/plugin/https.d.ts.map +0 -1
- package/dist/plugin/https.js +0 -47
- package/dist/plugin/https.js.map +0 -1
- package/dist/plugin/index.d.ts +0 -3
- package/dist/plugin/index.d.ts.map +0 -1
- package/dist/plugin/index.js +0 -15
- package/dist/plugin/index.js.map +0 -1
- package/dist/struct/CustomPlugin.d.ts +0 -10
- package/dist/struct/CustomPlugin.d.ts.map +0 -1
- package/dist/struct/CustomPlugin.js +0 -16
- package/dist/struct/CustomPlugin.js.map +0 -1
- package/dist/struct/DisTubeError.d.ts +0 -55
- package/dist/struct/DisTubeError.d.ts.map +0 -1
- package/dist/struct/DisTubeError.js +0 -64
- package/dist/struct/DisTubeError.js.map +0 -1
- package/dist/struct/ExtractorPlugin.d.ts +0 -13
- package/dist/struct/ExtractorPlugin.d.ts.map +0 -1
- package/dist/struct/ExtractorPlugin.js +0 -16
- package/dist/struct/ExtractorPlugin.js.map +0 -1
- package/dist/struct/Playlist.d.ts +0 -25
- package/dist/struct/Playlist.d.ts.map +0 -1
- package/dist/struct/Playlist.js +0 -77
- package/dist/struct/Playlist.js.map +0 -1
- package/dist/struct/Plugin.d.ts +0 -17
- package/dist/struct/Plugin.d.ts.map +0 -1
- package/dist/struct/Plugin.js +0 -37
- package/dist/struct/Plugin.js.map +0 -1
- package/dist/struct/Queue.d.ts +0 -49
- package/dist/struct/Queue.d.ts.map +0 -1
- package/dist/struct/Queue.js +0 -272
- package/dist/struct/Queue.js.map +0 -1
- package/dist/struct/SearchResult.d.ts +0 -19
- package/dist/struct/SearchResult.d.ts.map +0 -1
- package/dist/struct/SearchResult.js +0 -30
- package/dist/struct/SearchResult.js.map +0 -1
- package/dist/struct/Song.d.ts +0 -43
- package/dist/struct/Song.d.ts.map +0 -1
- package/dist/struct/Song.js +0 -138
- package/dist/struct/Song.js.map +0 -1
- package/dist/struct/TaskQueue.d.ts +0 -8
- package/dist/struct/TaskQueue.d.ts.map +0 -1
- package/dist/struct/TaskQueue.js +0 -39
- package/dist/struct/TaskQueue.js.map +0 -1
- package/dist/struct/index.d.ts +0 -10
- package/dist/struct/index.d.ts.map +0 -1
- package/dist/struct/index.js +0 -22
- package/dist/struct/index.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/type.d.ts +0 -104
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -3
- package/dist/type.js.map +0 -1
- package/dist/util.d.ts +0 -22
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -189
- package/dist/util.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "distube",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
4
|
-
"description": "A Discord.js module to simplify your music commands and play songs with audio filters on Discord without any API key.
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"
|
|
3
|
+
"version": "4.0.0-dev.5",
|
|
4
|
+
"description": "A Discord.js module to simplify your music commands and play songs with audio filters on Discord without any API key.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"import": "./dist/index.mjs",
|
|
10
|
+
"require": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"directories": {
|
|
13
|
+
"lib": "src",
|
|
14
|
+
"test": "tests"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
7
19
|
"scripts": {
|
|
8
|
-
"test": "jest
|
|
9
|
-
"docs": "docgen -s src/*.ts src/**/*.ts -o docs
|
|
10
|
-
"lint": "eslint .",
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"docs": "docgen -s src/*.ts src/**/*.ts -o docs.json -c pages/index.yml -g -j jsdoc.config.json",
|
|
22
|
+
"lint": "prettier --check . && eslint .",
|
|
11
23
|
"lint:fix": "eslint . --fix",
|
|
12
|
-
"prettier": "prettier --write **/*.{ts,json,yml,yaml,md}",
|
|
13
|
-
"build": "
|
|
14
|
-
"build:check": "tsc --noEmit
|
|
15
|
-
"
|
|
16
|
-
"ncu": "ncu -u --dep dev,prod",
|
|
24
|
+
"prettier": "prettier --write \"**/*.{ts,json,yml,yaml,md}\"",
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"build:check": "tsc --noEmit",
|
|
27
|
+
"update": "ncu -u --dep dev,prod && yarn up '**' -R",
|
|
17
28
|
"_postinstall": "husky install",
|
|
18
|
-
"prepublishOnly": "
|
|
19
|
-
"
|
|
29
|
+
"prepublishOnly": "yarn lint && yarn test",
|
|
30
|
+
"prepack": "yarn build && pinst --disable",
|
|
31
|
+
"postpack": "pinst --enable"
|
|
20
32
|
},
|
|
21
33
|
"repository": {
|
|
22
34
|
"type": "git",
|
|
@@ -40,42 +52,55 @@
|
|
|
40
52
|
"bugs": {
|
|
41
53
|
"url": "https://github.com/skick1234/DisTube/issues"
|
|
42
54
|
},
|
|
43
|
-
"funding":
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
"funding": [
|
|
56
|
+
{
|
|
57
|
+
"type": "individual",
|
|
58
|
+
"url": "https://paypal.me/Skickkk"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"type": "patreon",
|
|
62
|
+
"url": "https://patreon.com/DisTube"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
46
65
|
"homepage": "https://distube.js.org/",
|
|
47
66
|
"dependencies": {
|
|
48
|
-
"@distube/ytdl-core": "^4.
|
|
67
|
+
"@distube/ytdl-core": "^4.11.3",
|
|
49
68
|
"@distube/ytpl": "^1.1.1",
|
|
50
69
|
"@distube/ytsr": "^1.1.5",
|
|
51
70
|
"prism-media": "https://codeload.github.com/distubejs/prism-media/tar.gz/main#workaround.tar.gz",
|
|
52
|
-
"tiny-typed-emitter": "^2.1.0"
|
|
71
|
+
"tiny-typed-emitter": "^2.1.0",
|
|
72
|
+
"tslib": "^2.4.0"
|
|
53
73
|
},
|
|
54
74
|
"devDependencies": {
|
|
55
|
-
"@babel/core": "^7.
|
|
56
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
57
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
58
|
-
"@babel/preset-env": "^7.
|
|
59
|
-
"@babel/preset-typescript": "^7.
|
|
60
|
-
"@commitlint/cli": "^
|
|
61
|
-
"@commitlint/config-conventional": "^
|
|
62
|
-
"@discordjs/voice": "
|
|
63
|
-
"@distube/docgen": "
|
|
64
|
-
"@types/jest": "^27.
|
|
65
|
-
"@types/node": "^17.0.
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"eslint
|
|
71
|
-
"
|
|
72
|
-
"
|
|
75
|
+
"@babel/core": "^7.18.0",
|
|
76
|
+
"@babel/plugin-proposal-class-properties": "^7.17.12",
|
|
77
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.18.0",
|
|
78
|
+
"@babel/preset-env": "^7.18.0",
|
|
79
|
+
"@babel/preset-typescript": "^7.17.12",
|
|
80
|
+
"@commitlint/cli": "^17.0.0",
|
|
81
|
+
"@commitlint/config-conventional": "^17.0.0",
|
|
82
|
+
"@discordjs/voice": "dev",
|
|
83
|
+
"@distube/docgen": "distubejs/docgen",
|
|
84
|
+
"@types/jest": "^27.5.1",
|
|
85
|
+
"@types/node": "^17.0.35",
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.25.0",
|
|
87
|
+
"@typescript-eslint/parser": "^5.25.0",
|
|
88
|
+
"babel-jest": "^28.1.0",
|
|
89
|
+
"discord.js": "dev",
|
|
90
|
+
"eslint": "^8.15.0",
|
|
91
|
+
"eslint-config-distube": "^1.6.4",
|
|
92
|
+
"eslint-config-prettier": "^8.5.0",
|
|
93
|
+
"eslint-plugin-deprecation": "^1.3.2",
|
|
94
|
+
"eslint-plugin-jsdoc": "^39.3.0",
|
|
95
|
+
"husky": "^8.0.1",
|
|
96
|
+
"jest": "^28.1.0",
|
|
73
97
|
"jsdoc-babel": "^0.5.0",
|
|
74
|
-
"nano-staged": "^0.
|
|
75
|
-
"npm-check-updates": "^
|
|
76
|
-
"pinst": "^
|
|
77
|
-
"prettier": "^2.
|
|
78
|
-
"
|
|
98
|
+
"nano-staged": "^0.8.0",
|
|
99
|
+
"npm-check-updates": "^13.0.1",
|
|
100
|
+
"pinst": "^3.0.0",
|
|
101
|
+
"prettier": "^2.6.2",
|
|
102
|
+
"tsup": "^5.12.8",
|
|
103
|
+
"typescript": "^4.6.4"
|
|
79
104
|
},
|
|
80
105
|
"peerDependencies": {
|
|
81
106
|
"@discordjs/opus": "*",
|
|
@@ -97,6 +122,8 @@
|
|
|
97
122
|
]
|
|
98
123
|
},
|
|
99
124
|
"engines": {
|
|
100
|
-
"node": ">=16.
|
|
101
|
-
}
|
|
102
|
-
|
|
125
|
+
"node": ">=16.9.0"
|
|
126
|
+
},
|
|
127
|
+
"packageManager": "yarn@3.2.0",
|
|
128
|
+
"stableVersion": "4.0.0-dev"
|
|
129
|
+
}
|
package/dist/DisTube.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { TypedEmitter } from "tiny-typed-emitter";
|
|
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;
|
|
6
|
-
export declare class DisTube extends TypedEmitter<DisTubeEvents> {
|
|
7
|
-
readonly handler: DisTubeHandler;
|
|
8
|
-
readonly options: Options;
|
|
9
|
-
readonly client: Client;
|
|
10
|
-
readonly queues: QueueManager;
|
|
11
|
-
readonly voices: DisTubeVoiceManager;
|
|
12
|
-
readonly extractorPlugins: ExtractorPlugin[];
|
|
13
|
-
readonly customPlugins: CustomPlugin[];
|
|
14
|
-
readonly filters: Filters;
|
|
15
|
-
constructor(client: Client, otp?: DisTubeOptions);
|
|
16
|
-
static get version(): string;
|
|
17
|
-
get version(): string;
|
|
18
|
-
play(voiceChannel: VoiceBasedChannel, song: string | Song | SearchResult | Playlist, options?: {
|
|
19
|
-
skip?: boolean;
|
|
20
|
-
position?: number;
|
|
21
|
-
member?: GuildMember;
|
|
22
|
-
textChannel?: GuildTextBasedChannel;
|
|
23
|
-
message?: Message;
|
|
24
|
-
metadata?: any;
|
|
25
|
-
}): Promise<void>;
|
|
26
|
-
createCustomPlaylist(songs: (string | Song | SearchResult)[], options?: {
|
|
27
|
-
member?: GuildMember;
|
|
28
|
-
properties?: Record<string, any>;
|
|
29
|
-
parallel?: boolean;
|
|
30
|
-
metadata?: any;
|
|
31
|
-
}): Promise<Playlist>;
|
|
32
|
-
search(string: string, options?: {
|
|
33
|
-
type?: "video" | "playlist";
|
|
34
|
-
limit?: number;
|
|
35
|
-
safeSearch?: boolean;
|
|
36
|
-
retried?: boolean;
|
|
37
|
-
}): Promise<Array<SearchResult>>;
|
|
38
|
-
getQueue(guild: GuildIdResolvable): Queue | undefined;
|
|
39
|
-
pause(guild: GuildIdResolvable): Queue;
|
|
40
|
-
resume(guild: GuildIdResolvable): Queue;
|
|
41
|
-
stop(guild: GuildIdResolvable): Promise<void>;
|
|
42
|
-
setVolume(guild: GuildIdResolvable, percent: number): Queue;
|
|
43
|
-
skip(guild: GuildIdResolvable): Promise<Song>;
|
|
44
|
-
previous(guild: GuildIdResolvable): Promise<Song>;
|
|
45
|
-
shuffle(guild: GuildIdResolvable): Promise<Queue>;
|
|
46
|
-
jump(guild: GuildIdResolvable, num: number): Promise<Song>;
|
|
47
|
-
setRepeatMode(guild: GuildIdResolvable, mode?: number): number;
|
|
48
|
-
toggleAutoplay(guild: GuildIdResolvable): boolean;
|
|
49
|
-
addRelatedSong(guild: GuildIdResolvable): Promise<Song>;
|
|
50
|
-
seek(guild: GuildIdResolvable, time: number): Queue;
|
|
51
|
-
emitError(error: Error, channel?: GuildTextBasedChannel): void;
|
|
52
|
-
}
|
|
53
|
-
export default DisTube;
|
|
54
|
-
//# sourceMappingURL=DisTube.d.ts.map
|
package/dist/DisTube.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisTube.d.ts","s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GAAG,OAAO,CAAC,KAAK,CAAC;IAwBjD,IAAI,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC1D,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;IAsB9D,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO;IAYjD,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBvD,IAAI,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK;IAYnD,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI;CAa/D;AAED,eAAe,OAAO,CAAC"}
|
package/dist/DisTube.js
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DisTube = exports.version = void 0;
|
|
7
|
-
const ytpl_1 = __importDefault(require("@distube/ytpl"));
|
|
8
|
-
const ytsr_1 = __importDefault(require("@distube/ytsr"));
|
|
9
|
-
const util_1 = require("./util");
|
|
10
|
-
const tiny_typed_emitter_1 = require("tiny-typed-emitter");
|
|
11
|
-
const _1 = require(".");
|
|
12
|
-
exports.version = require("../package.json").version;
|
|
13
|
-
class DisTube extends tiny_typed_emitter_1.TypedEmitter {
|
|
14
|
-
constructor(client, otp = {}) {
|
|
15
|
-
super();
|
|
16
|
-
this.setMaxListeners(1);
|
|
17
|
-
if (!(0, _1.isClientInstance)(client))
|
|
18
|
-
throw new _1.DisTubeError("INVALID_TYPE", "Discord.Client", client, "client");
|
|
19
|
-
this.client = client;
|
|
20
|
-
(0, util_1.checkIntents)(client.options);
|
|
21
|
-
this.options = new _1.Options(otp);
|
|
22
|
-
this.voices = new _1.DisTubeVoiceManager(this);
|
|
23
|
-
this.handler = new _1.DisTubeHandler(this);
|
|
24
|
-
this.queues = new _1.QueueManager(this);
|
|
25
|
-
this.filters = { ..._1.defaultFilters, ...this.options.customFilters };
|
|
26
|
-
this.options.plugins.push(new _1.HTTPPlugin(), new _1.HTTPSPlugin());
|
|
27
|
-
this.options.plugins.map(p => p.init(this));
|
|
28
|
-
this.extractorPlugins = this.options.plugins.filter((p) => p.type === "extractor");
|
|
29
|
-
this.customPlugins = this.options.plugins.filter((p) => p.type === "custom");
|
|
30
|
-
}
|
|
31
|
-
static get version() {
|
|
32
|
-
return exports.version;
|
|
33
|
-
}
|
|
34
|
-
get version() {
|
|
35
|
-
return exports.version;
|
|
36
|
-
}
|
|
37
|
-
async play(voiceChannel, song, options = {}) {
|
|
38
|
-
if (!(0, _1.isSupportedVoiceChannel)(voiceChannel)) {
|
|
39
|
-
throw new _1.DisTubeError("INVALID_TYPE", "BaseGuildVoiceChannel", voiceChannel, "voiceChannel");
|
|
40
|
-
}
|
|
41
|
-
if (!(0, util_1.isObject)(options))
|
|
42
|
-
throw new _1.DisTubeError("INVALID_TYPE", "object", options, "options");
|
|
43
|
-
const { textChannel, member, skip, message, metadata } = {
|
|
44
|
-
member: voiceChannel.guild.me ?? undefined,
|
|
45
|
-
textChannel: options?.message?.channel,
|
|
46
|
-
skip: false,
|
|
47
|
-
...options,
|
|
48
|
-
};
|
|
49
|
-
let position = Number(options.position);
|
|
50
|
-
if (!position) {
|
|
51
|
-
if (skip && position !== 0)
|
|
52
|
-
position = 1;
|
|
53
|
-
else
|
|
54
|
-
position = 0;
|
|
55
|
-
}
|
|
56
|
-
if (message && !(0, _1.isMessageInstance)(message)) {
|
|
57
|
-
throw new _1.DisTubeError("INVALID_TYPE", ["Discord.Message", "a falsy value"], message, "options.message");
|
|
58
|
-
}
|
|
59
|
-
if (textChannel && !(0, _1.isTextChannelInstance)(textChannel)) {
|
|
60
|
-
throw new _1.DisTubeError("INVALID_TYPE", "Discord.GuildTextBasedChannel", textChannel, "options.textChannel");
|
|
61
|
-
}
|
|
62
|
-
if (member && !(0, _1.isMemberInstance)(member)) {
|
|
63
|
-
throw new _1.DisTubeError("INVALID_TYPE", "Discord.GuildMember", member, "options.member");
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
if (typeof song === "string") {
|
|
67
|
-
for (const plugin of this.customPlugins) {
|
|
68
|
-
if (await plugin.validate(song)) {
|
|
69
|
-
return plugin.play(voiceChannel, song, options);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
let queue = this.getQueue(voiceChannel);
|
|
74
|
-
const queuing = !!queue && !queue._taskQueue.hasResolveTask;
|
|
75
|
-
if (queuing)
|
|
76
|
-
await queue?._taskQueue.queuing(true);
|
|
77
|
-
try {
|
|
78
|
-
if (song instanceof _1.SearchResult && song.type === "playlist")
|
|
79
|
-
song = song.url;
|
|
80
|
-
if (typeof song === "string" && ytpl_1.default.validateID(song)) {
|
|
81
|
-
song = await this.handler.resolvePlaylist(song, { member, metadata });
|
|
82
|
-
}
|
|
83
|
-
if (typeof song === "string" && !(0, util_1.isURL)(song)) {
|
|
84
|
-
if (!message) {
|
|
85
|
-
song = (await this.search(song, { limit: 1 }))[0];
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
const result = await this.handler.searchSong(message, song);
|
|
89
|
-
if (!result)
|
|
90
|
-
return;
|
|
91
|
-
song = result;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
song = await this.handler.resolveSong(song, { member, metadata });
|
|
95
|
-
if (song instanceof _1.Playlist) {
|
|
96
|
-
await this.handler.handlePlaylist(voiceChannel, song, { textChannel, skip, position });
|
|
97
|
-
}
|
|
98
|
-
else if (!this.options.nsfw && song.age_restricted && !textChannel?.nsfw) {
|
|
99
|
-
throw new _1.DisTubeError("NON_NSFW");
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
queue = this.getQueue(voiceChannel);
|
|
103
|
-
if (queue) {
|
|
104
|
-
queue.addToQueue(song, position);
|
|
105
|
-
if (skip)
|
|
106
|
-
queue.skip();
|
|
107
|
-
else
|
|
108
|
-
this.emit("addSong", queue, song);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
const newQueue = await this.queues.create(voiceChannel, song, textChannel);
|
|
112
|
-
if (newQueue instanceof _1.Queue) {
|
|
113
|
-
if (this.options.emitAddSongWhenCreatingQueue)
|
|
114
|
-
this.emit("addSong", newQueue, song);
|
|
115
|
-
this.emit("playSong", newQueue, song);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
finally {
|
|
121
|
-
if (queuing)
|
|
122
|
-
queue?._taskQueue.resolve();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
catch (e) {
|
|
126
|
-
if (!(e instanceof _1.DisTubeError)) {
|
|
127
|
-
try {
|
|
128
|
-
e.name = "PlayError";
|
|
129
|
-
e.message = `${song?.url || song}\n${e.message}`;
|
|
130
|
-
}
|
|
131
|
-
catch { }
|
|
132
|
-
}
|
|
133
|
-
this.emitError(e, textChannel);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async createCustomPlaylist(songs, options = {}) {
|
|
137
|
-
const { member, properties, parallel, metadata } = { parallel: true, ...options };
|
|
138
|
-
if (!Array.isArray(songs))
|
|
139
|
-
throw new _1.DisTubeError("INVALID_TYPE", "Array", songs, "songs");
|
|
140
|
-
if (!songs.length)
|
|
141
|
-
throw new _1.DisTubeError("EMPTY_ARRAY", "songs");
|
|
142
|
-
const filteredSongs = songs.filter(song => song instanceof _1.Song || (song instanceof _1.SearchResult && song.type === "video") || (0, util_1.isURL)(song));
|
|
143
|
-
if (!filteredSongs.length)
|
|
144
|
-
throw new _1.DisTubeError("NO_VALID_SONG");
|
|
145
|
-
if (member && !(0, _1.isMemberInstance)(member)) {
|
|
146
|
-
throw new _1.DisTubeError("INVALID_TYPE", "Discord.Member", member, "options.member");
|
|
147
|
-
}
|
|
148
|
-
if (!filteredSongs.length)
|
|
149
|
-
throw new _1.DisTubeError("NO_VALID_SONG");
|
|
150
|
-
let resolvedSongs;
|
|
151
|
-
if (parallel) {
|
|
152
|
-
const promises = filteredSongs.map((song) => this.handler.resolveSong(song, { member, metadata }).catch(() => undefined));
|
|
153
|
-
resolvedSongs = (await Promise.all(promises)).filter((s) => !!s);
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
const resolved = [];
|
|
157
|
-
for (const song of filteredSongs) {
|
|
158
|
-
resolved.push(await this.handler.resolveSong(song, { member, metadata }).catch(() => undefined));
|
|
159
|
-
}
|
|
160
|
-
resolvedSongs = resolved.filter((s) => !!s);
|
|
161
|
-
}
|
|
162
|
-
return new _1.Playlist(resolvedSongs, { member, properties, metadata });
|
|
163
|
-
}
|
|
164
|
-
async search(string, options = {}) {
|
|
165
|
-
const opts = { type: "video", limit: 10, safeSearch: false, ...options };
|
|
166
|
-
if (typeof opts.type !== "string" || !["video", "playlist"].includes(opts.type)) {
|
|
167
|
-
throw new _1.DisTubeError("INVALID_TYPE", ["video", "playlist"], opts.type, "options.type");
|
|
168
|
-
}
|
|
169
|
-
if (typeof opts.limit !== "number")
|
|
170
|
-
throw new _1.DisTubeError("INVALID_TYPE", "number", opts.limit, "options.limit");
|
|
171
|
-
if (opts.limit < 1)
|
|
172
|
-
throw new _1.DisTubeError("NUMBER_COMPARE", "option.limit", "bigger or equal to", 1);
|
|
173
|
-
if (typeof opts.safeSearch !== "boolean") {
|
|
174
|
-
throw new _1.DisTubeError("INVALID_TYPE", "boolean", opts.safeSearch, "options.safeSearch");
|
|
175
|
-
}
|
|
176
|
-
try {
|
|
177
|
-
const search = await (0, ytsr_1.default)(string, opts);
|
|
178
|
-
const results = search.items.map(i => new _1.SearchResult(i));
|
|
179
|
-
if (results.length === 0)
|
|
180
|
-
throw new _1.DisTubeError("NO_RESULT");
|
|
181
|
-
return results;
|
|
182
|
-
}
|
|
183
|
-
catch (e) {
|
|
184
|
-
if (options.retried)
|
|
185
|
-
throw e;
|
|
186
|
-
options.retried = true;
|
|
187
|
-
return this.search(string, options);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
getQueue(guild) {
|
|
191
|
-
return this.queues.get(guild);
|
|
192
|
-
}
|
|
193
|
-
pause(guild) {
|
|
194
|
-
const q = this.getQueue(guild);
|
|
195
|
-
if (!q)
|
|
196
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
197
|
-
return q.pause();
|
|
198
|
-
}
|
|
199
|
-
resume(guild) {
|
|
200
|
-
const q = this.getQueue(guild);
|
|
201
|
-
if (!q)
|
|
202
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
203
|
-
return q.resume();
|
|
204
|
-
}
|
|
205
|
-
stop(guild) {
|
|
206
|
-
const q = this.getQueue(guild);
|
|
207
|
-
if (!q)
|
|
208
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
209
|
-
return q.stop();
|
|
210
|
-
}
|
|
211
|
-
setVolume(guild, percent) {
|
|
212
|
-
const q = this.getQueue(guild);
|
|
213
|
-
if (!q)
|
|
214
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
215
|
-
return q.setVolume(percent);
|
|
216
|
-
}
|
|
217
|
-
skip(guild) {
|
|
218
|
-
const q = this.getQueue(guild);
|
|
219
|
-
if (!q)
|
|
220
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
221
|
-
return q.skip();
|
|
222
|
-
}
|
|
223
|
-
previous(guild) {
|
|
224
|
-
const q = this.getQueue(guild);
|
|
225
|
-
if (!q)
|
|
226
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
227
|
-
return q.previous();
|
|
228
|
-
}
|
|
229
|
-
shuffle(guild) {
|
|
230
|
-
const q = this.getQueue(guild);
|
|
231
|
-
if (!q)
|
|
232
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
233
|
-
return q.shuffle();
|
|
234
|
-
}
|
|
235
|
-
jump(guild, num) {
|
|
236
|
-
const q = this.getQueue(guild);
|
|
237
|
-
if (!q)
|
|
238
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
239
|
-
return q.jump(num);
|
|
240
|
-
}
|
|
241
|
-
setRepeatMode(guild, mode) {
|
|
242
|
-
const q = this.getQueue(guild);
|
|
243
|
-
if (!q)
|
|
244
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
245
|
-
return q.setRepeatMode(mode);
|
|
246
|
-
}
|
|
247
|
-
toggleAutoplay(guild) {
|
|
248
|
-
const q = this.getQueue(guild);
|
|
249
|
-
if (!q)
|
|
250
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
251
|
-
q.autoplay = !q.autoplay;
|
|
252
|
-
return q.autoplay;
|
|
253
|
-
}
|
|
254
|
-
addRelatedSong(guild) {
|
|
255
|
-
const q = this.getQueue(guild);
|
|
256
|
-
if (!q)
|
|
257
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
258
|
-
return q.addRelatedSong();
|
|
259
|
-
}
|
|
260
|
-
seek(guild, time) {
|
|
261
|
-
const q = this.getQueue(guild);
|
|
262
|
-
if (!q)
|
|
263
|
-
throw new _1.DisTubeError("NO_QUEUE");
|
|
264
|
-
return q.seek(time);
|
|
265
|
-
}
|
|
266
|
-
emitError(error, channel) {
|
|
267
|
-
if (this.listeners("error").length) {
|
|
268
|
-
this.emit("error", channel, error);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
console.error(error);
|
|
272
|
-
console.warn("Unhandled 'error' event.");
|
|
273
|
-
console.warn("See: https://distube.js.org/#/docs/DisTube/stable/class/DisTube?scrollTo=e-error and https://nodejs.org/api/events.html#events_error_events");
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
exports.DisTube = DisTube;
|
|
278
|
-
exports.default = DisTube;
|
|
279
|
-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AK,CAAC,CAAC;SACpC;aAAM;YAEL,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;YACzC,OAAO,CAAC,IAAI,CACV,6IAA6I,CAC9I,CAAC;SAEH;IACH,CAAC;CACF;AAnlBD,0BAmlBC;AAED,kBAAe,OAAO,CAAC","sourcesContent":["import ytpl from \"@distube/ytpl\";\nimport ytsr from \"@distube/ytsr\";\nimport { checkIntents, isObject, isURL } from \"./util\";\nimport { TypedEmitter } from \"tiny-typed-emitter\";\nimport {\n DisTubeError,\n DisTubeHandler,\n DisTubeVoiceManager,\n HTTPPlugin,\n HTTPSPlugin,\n Options,\n Playlist,\n Queue,\n QueueManager,\n SearchResult,\n Song,\n defaultFilters,\n isClientInstance,\n isMemberInstance,\n isMessageInstance,\n isSupportedVoiceChannel,\n isTextChannelInstance,\n} from \".\";\nimport type { Client, GuildMember, GuildTextBasedChannel, Message, TextChannel, VoiceBasedChannel } from \"discord.js\";\nimport type { CustomPlugin, DisTubeEvents, DisTubeOptions, ExtractorPlugin, Filters, GuildIdResolvable } from \".\";\n\n// Cannot be `import` as it's not under TS root dir\n// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports\nexport const { version }: { version: string } = require(\"../package.json\");\n\n/**\n * DisTube class\n * @extends EventEmitter\n */\nexport class DisTube extends TypedEmitter<DisTubeEvents> {\n readonly handler: DisTubeHandler;\n readonly options: Options;\n readonly client: Client;\n readonly queues: QueueManager;\n readonly voices: DisTubeVoiceManager;\n readonly extractorPlugins: ExtractorPlugin[];\n readonly customPlugins: CustomPlugin[];\n readonly filters: Filters;\n /**\n * Create a new DisTube class.\n * @param {Discord.Client} client Discord.JS client\n * @param {DisTubeOptions} [otp] Custom DisTube options\n * @example\n * const Discord = require('discord.js'),\n * DisTube = require('distube'),\n * client = new Discord.Client();\n * // Create a new DisTube\n * const distube = new DisTube.default(client, { searchSongs: 10 });\n * // client.DisTube = distube // make it access easily\n * client.login(\"Your Discord Bot Token\")\n */\n constructor(client: Client, otp: DisTubeOptions = {}) {\n super();\n this.setMaxListeners(1);\n if (!isClientInstance(client)) throw new DisTubeError(\"INVALID_TYPE\", \"Discord.Client\", client, \"client\");\n /**\n * Discord.JS client\n * @type {Discord.Client}\n */\n this.client = client;\n checkIntents(client.options);\n /**\n * DisTube options\n * @type {DisTubeOptions}\n */\n this.options = new Options(otp);\n /**\n * Voice connections manager\n * @type {DisTubeVoiceManager}\n */\n this.voices = new DisTubeVoiceManager(this);\n /**\n * DisTube's Handler\n * @type {DisTubeHandler}\n * @private\n */\n this.handler = new DisTubeHandler(this);\n /**\n * Queues manager\n * @type {QueueManager}\n */\n this.queues = new QueueManager(this);\n /**\n * DisTube filters\n * @type {Filters}\n */\n this.filters = { ...defaultFilters, ...this.options.customFilters };\n // Default plugin\n this.options.plugins.push(new HTTPPlugin(), new HTTPSPlugin());\n this.options.plugins.map(p => p.init(this));\n /**\n * Extractor Plugins\n * @type {ExtractorPlugin[]}\n * @private\n */\n this.extractorPlugins = this.options.plugins.filter((p): p is ExtractorPlugin => p.type === \"extractor\");\n /**\n * Custom Plugins\n * @type {CustomPlugin[]}\n * @private\n */\n this.customPlugins = this.options.plugins.filter((p): p is CustomPlugin => p.type === \"custom\");\n }\n\n static get version() {\n return version;\n }\n\n /**\n * DisTube version\n * @type {string}\n */\n get version() {\n return version;\n }\n\n /**\n * Play / add a song or playlist from url. Search and play a song if it is not a valid url.\n *\n * @param {Discord.BaseGuildVoiceChannel} voiceChannel The channel will be joined if the bot isn't in any channels,\n * the bot will be moved to this channel if `options.move` is `true`\n * @param {string|Song|SearchResult|Playlist} song URL | Search string |\n * {@link Song} | {@link SearchResult} | {@link Playlist}\n * @param {Object} [options] Optional options\n * @param {Discord.GuildMember} [options.member] Requested user (default is your bot)\n * @param {Discord.BaseGuildTextChannel} [options.textChannel] Default {@link Queue#textChannel}\n * @param {boolean} [options.skip=false]\n * Skip the playing song (if exists) and play the added song/playlist if `position` is 1.\n * If `position` is defined and not equal to 1, it will skip to the next song instead of the added song\n * @param {number} [options.position=0] Position of the song/playlist to add to the queue,\n * <= 0 to add to the end of the queue.\n * @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)\n * @param {*} [options.metadata] Optional metadata that can be attached to the song/playlist will be played,\n * This is useful for identification purposes when the song/playlist is passed around in events.\n * See {@link Song#metadata} or {@link Playlist#metadata}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"play\")\n * distube.play(message.member.voice.channel, args.join(\" \"), {\n * member: message.member,\n * textChannel: message.channel,\n * message\n * });\n * });\n * @returns {Promise<void>}\n */\n async play(\n voiceChannel: VoiceBasedChannel,\n song: string | Song | SearchResult | Playlist,\n options: {\n skip?: boolean;\n position?: number;\n member?: GuildMember;\n textChannel?: GuildTextBasedChannel;\n message?: Message;\n metadata?: any;\n } = {},\n ): Promise<void> {\n if (!isSupportedVoiceChannel(voiceChannel)) {\n throw new DisTubeError(\"INVALID_TYPE\", \"BaseGuildVoiceChannel\", voiceChannel, \"voiceChannel\");\n }\n if (!isObject(options)) throw new DisTubeError(\"INVALID_TYPE\", \"object\", options, \"options\");\n\n const { textChannel, member, skip, message, metadata } = {\n member: voiceChannel.guild.me ?? undefined,\n textChannel: options?.message?.channel,\n skip: false,\n ...options,\n };\n\n let position = Number(options.position);\n if (!position) {\n if (skip && position !== 0) position = 1;\n else position = 0;\n }\n\n if (message && !isMessageInstance(message)) {\n throw new DisTubeError(\"INVALID_TYPE\", [\"Discord.Message\", \"a falsy value\"], message, \"options.message\");\n }\n if (textChannel && !isTextChannelInstance(textChannel)) {\n throw new DisTubeError(\"INVALID_TYPE\", \"Discord.GuildTextBasedChannel\", textChannel, \"options.textChannel\");\n }\n if (member && !isMemberInstance(member)) {\n throw new DisTubeError(\"INVALID_TYPE\", \"Discord.GuildMember\", member, \"options.member\");\n }\n try {\n if (typeof song === \"string\") {\n for (const plugin of this.customPlugins) {\n if (await plugin.validate(song)) {\n return plugin.play(voiceChannel, song, options);\n }\n }\n }\n let queue = this.getQueue(voiceChannel);\n const queuing = !!queue && !queue._taskQueue.hasResolveTask;\n if (queuing) await queue?._taskQueue.queuing(true);\n try {\n if (song instanceof SearchResult && song.type === \"playlist\") song = song.url;\n if (typeof song === \"string\" && ytpl.validateID(song)) {\n song = await this.handler.resolvePlaylist(song, { member, metadata });\n }\n if (typeof song === \"string\" && !isURL(song)) {\n if (!message) {\n song = (await this.search(song, { limit: 1 }))[0];\n } else {\n const result = await this.handler.searchSong(message, song);\n if (!result) return;\n song = result;\n }\n }\n song = await this.handler.resolveSong(song, { member, metadata });\n if (song instanceof Playlist) {\n await this.handler.handlePlaylist(voiceChannel, song, { textChannel, skip, position });\n } else if (!this.options.nsfw && song.age_restricted && !(textChannel as TextChannel)?.nsfw) {\n throw new DisTubeError(\"NON_NSFW\");\n } else {\n queue = this.getQueue(voiceChannel);\n if (queue) {\n queue.addToQueue(song, position);\n if (skip) queue.skip();\n else this.emit(\"addSong\", queue, song);\n } else {\n const newQueue = await this.queues.create(voiceChannel, song, textChannel);\n if (newQueue instanceof Queue) {\n if (this.options.emitAddSongWhenCreatingQueue) this.emit(\"addSong\", newQueue, song);\n this.emit(\"playSong\", newQueue, song);\n }\n }\n }\n } finally {\n if (queuing) queue?._taskQueue.resolve();\n }\n } catch (e: any) {\n if (!(e instanceof DisTubeError)) {\n try {\n e.name = \"PlayError\";\n e.message = `${(song as Song)?.url || song}\\n${e.message}`;\n } catch {}\n }\n this.emitError(e, textChannel);\n }\n }\n\n /**\n * Create a custom playlist\n * @returns {Promise<Playlist>}\n * @param {Array<string|Song|SearchResult>} songs Array of url, Song or SearchResult\n * @param {Object} [options] Optional options\n * @param {Discord.GuildMember} [options.message] A message from guild channel | A guild member\n * @param {Object} [options.properties] Additional properties such as `name`\n * @param {boolean} [options.parallel=true] Whether or not fetch the songs in parallel\n * @param {*} [options.metadata] Metadata\n * @example\n * const songs = [\"https://www.youtube.com/watch?v=xxx\", \"https://www.youtube.com/watch?v=yyy\"];\n * const playlist = await distube.createCustomPlaylist(songs, {\n * member: message.member,\n * properties: { name: \"My playlist name\" },\n * parallel: true\n * });\n * distube.play(voiceChannel, playlist, { ... });\n */\n async createCustomPlaylist(\n songs: (string | Song | SearchResult)[],\n options: {\n member?: GuildMember;\n properties?: Record<string, any>;\n parallel?: boolean;\n metadata?: any;\n } = {},\n ): Promise<Playlist> {\n const { member, properties, parallel, metadata } = { parallel: true, ...options };\n if (!Array.isArray(songs)) throw new DisTubeError(\"INVALID_TYPE\", \"Array\", songs, \"songs\");\n if (!songs.length) throw new DisTubeError(\"EMPTY_ARRAY\", \"songs\");\n const filteredSongs = songs.filter(\n song => song instanceof Song || (song instanceof SearchResult && song.type === \"video\") || isURL(song),\n );\n if (!filteredSongs.length) throw new DisTubeError(\"NO_VALID_SONG\");\n if (member && !isMemberInstance(member)) {\n throw new DisTubeError(\"INVALID_TYPE\", \"Discord.Member\", member, \"options.member\");\n }\n if (!filteredSongs.length) throw new DisTubeError(\"NO_VALID_SONG\");\n let resolvedSongs: Song[];\n if (parallel) {\n const promises = filteredSongs.map((song: string | Song | SearchResult) =>\n this.handler.resolveSong(song, { member, metadata }).catch(() => undefined),\n );\n resolvedSongs = (await Promise.all(promises)).filter((s: any): s is Song => !!s);\n } else {\n const resolved = [];\n for (const song of filteredSongs) {\n resolved.push(await this.handler.resolveSong(song, { member, metadata }).catch(() => undefined));\n }\n resolvedSongs = resolved.filter((s: any): s is Song => !!s);\n }\n return new Playlist(resolvedSongs, { member, properties, metadata });\n }\n\n /**\n * Search for a song. You can customize how user answers instead of send a number.\n * Then use {@link DisTube#play} to play it.\n *\n * @param {string} string The string search for\n * @param {Object} options Search options\n * @param {number} [options.limit=10] Limit the results\n * @param {'video'|'playlist'} [options.type='video'] Type of results (`video` or `playlist`).\n * @param {boolean} [options.safeSearch=false] Whether or not use safe search (YouTube restricted mode)\n * @throws {Error}\n * @returns {Promise<Array<SearchResult>>} Array of results\n */\n async search(\n string: string,\n options: { type?: \"video\" | \"playlist\"; limit?: number; safeSearch?: boolean; retried?: boolean } = {},\n ): Promise<Array<SearchResult>> {\n const opts = { type: \"video\" as const, limit: 10, safeSearch: false, ...options };\n if (typeof opts.type !== \"string\" || ![\"video\", \"playlist\"].includes(opts.type)) {\n throw new DisTubeError(\"INVALID_TYPE\", [\"video\", \"playlist\"], opts.type, \"options.type\");\n }\n if (typeof opts.limit !== \"number\") throw new DisTubeError(\"INVALID_TYPE\", \"number\", opts.limit, \"options.limit\");\n if (opts.limit < 1) throw new DisTubeError(\"NUMBER_COMPARE\", \"option.limit\", \"bigger or equal to\", 1);\n if (typeof opts.safeSearch !== \"boolean\") {\n throw new DisTubeError(\"INVALID_TYPE\", \"boolean\", opts.safeSearch, \"options.safeSearch\");\n }\n\n try {\n const search = await ytsr(string, opts);\n const results = search.items.map(i => new SearchResult(i));\n if (results.length === 0) throw new DisTubeError(\"NO_RESULT\");\n return results;\n } catch (e) {\n if (options.retried) throw e;\n options.retried = true;\n return this.search(string, options);\n }\n }\n\n /**\n * Get the guild queue\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Queue?}\n * @throws {Error}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"queue\") {\n * const queue = distube.getQueue(message);\n * message.channel.send('Current queue:\\n' + queue.songs.map((song, id) =>\n * `**${id+1}**. [${song.name}](${song.url}) - \\`${song.formattedDuration}\\``\n * ).join(\"\\n\"));\n * }\n * });\n */\n getQueue(guild: GuildIdResolvable): Queue | undefined {\n return this.queues.get(guild);\n }\n\n /**\n * Pause the guild stream\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Queue} The guild queue\n * @throws {Error}\n */\n pause(guild: GuildIdResolvable): Queue {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.pause();\n }\n\n /**\n * Resume the guild stream\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Queue} The guild queue\n * @throws {Error}\n */\n resume(guild: GuildIdResolvable): Queue {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.resume();\n }\n\n /**\n * Stop the guild stream\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Promise<void>}\n * @throws {Error}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"stop\") {\n * distube.stop(message);\n * message.channel.send(\"Stopped the queue!\");\n * }\n * });\n */\n stop(guild: GuildIdResolvable): Promise<void> {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.stop();\n }\n\n /**\n * Set the guild stream's volume\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @param {number} percent The percentage of volume you want to set\n * @returns {Queue} The guild queue\n * @throws {Error}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"volume\")\n * distube.setVolume(message, Number(args[0]));\n * });\n */\n setVolume(guild: GuildIdResolvable, percent: number): Queue {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.setVolume(percent);\n }\n\n /**\n * Skip the playing song if there is a next song in the queue.\n * <info>If {@link Queue#autoplay} is `true` and there is no up next song,\n * DisTube will add and play a related song.</info>\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Promise<Song>} The new Song will be played\n * @throws {Error}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"skip\")\n * distube.skip(message);\n * });\n */\n skip(guild: GuildIdResolvable): Promise<Song> {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.skip();\n }\n\n /**\n * Play the previous song\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Promise<Song>} The new Song will be played\n * @throws {Error}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"previous\")\n * distube.previous(message);\n * });\n */\n previous(guild: GuildIdResolvable): Promise<Song> {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.previous();\n }\n\n /**\n * Shuffle the guild queue songs\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Promise<Queue>} The guild queue\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"shuffle\")\n * distube.shuffle(message);\n * });\n */\n shuffle(guild: GuildIdResolvable): Promise<Queue> {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.shuffle();\n }\n\n /**\n * Jump to the song number in the queue.\n * The next one is 1, 2,...\n * The previous one is -1, -2,...\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @param {number} num The song number to play\n * @returns {Promise<Song>} The new Song will be played\n * @throws {Error} if `num` is invalid number (0 < num < {@link Queue#songs}.length)\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"jump\")\n * distube.jump(message, parseInt(args[0]))\n * .catch(err => message.channel.send(\"Invalid song number.\"));\n * });\n */\n jump(guild: GuildIdResolvable, num: number): Promise<Song> {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.jump(num);\n }\n\n /**\n * Set the repeat mode of the guild queue.\\\n * Toggle mode `(Disabled -> Song -> Queue -> Disabled ->...)` if `mode` is `undefined`\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @param {RepeatMode?} [mode] The repeat modes (toggle if `undefined`)\n * @returns {RepeatMode} The new repeat mode\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"repeat\") {\n * let mode = distube.setRepeatMode(message, parseInt(args[0]));\n * mode = mode ? mode == 2 ? \"Repeat queue\" : \"Repeat song\" : \"Off\";\n * message.channel.send(\"Set repeat mode to `\" + mode + \"`\");\n * }\n * });\n * @example\n * const { RepeatMode } = require(\"distube\");\n * let mode;\n * switch(distube.setRepeatMode(message, parseInt(args[0]))) {\n * case RepeatMode.DISABLED:\n * mode = \"Off\";\n * break;\n * case RepeatMode.SONG:\n * mode = \"Repeat a song\";\n * break;\n * case RepeatMode.QUEUE:\n * mode = \"Repeat all queue\";\n * break;\n * }\n * message.channel.send(\"Set repeat mode to `\" + mode + \"`\");\n */\n setRepeatMode(guild: GuildIdResolvable, mode?: number): number {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.setRepeatMode(mode);\n }\n\n /**\n * Toggle autoplay mode\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {boolean} Autoplay mode state\n * @throws {Error}\n * @example\n * client.on('message', (message) => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command == \"autoplay\") {\n * const mode = distube.toggleAutoplay(message);\n * message.channel.send(\"Set autoplay mode to `\" + (mode ? \"On\" : \"Off\") + \"`\");\n * }\n * });\n */\n toggleAutoplay(guild: GuildIdResolvable): boolean {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n q.autoplay = !q.autoplay;\n return q.autoplay;\n }\n\n /**\n * Add related song to the queue\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @returns {Promise<Song>} The guild queue\n */\n addRelatedSong(guild: GuildIdResolvable): Promise<Song> {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.addRelatedSong();\n }\n\n /**\n * Set the playing time to another position\n * @param {GuildIdResolvable} guild The type can be resolved to give a {@link Queue}\n * @param {number} time Time in seconds\n * @returns {Queue} Seeked queue\n * @example\n * client.on('message', message => {\n * if (!message.content.startsWith(config.prefix)) return;\n * const args = message.content.slice(config.prefix.length).trim().split(/ +/g);\n * const command = args.shift();\n * if (command = 'seek')\n * distube.seek(message, Number(args[0]));\n * });\n */\n seek(guild: GuildIdResolvable, time: number): Queue {\n const q = this.getQueue(guild);\n if (!q) throw new DisTubeError(\"NO_QUEUE\");\n return q.seek(time);\n }\n\n /**\n * Emit error event\n * @param {Error} error error\n * @param {Discord.BaseGuildTextChannel} [channel] Text channel where the error is encountered.\n * @private\n */\n emitError(error: Error, channel?: GuildTextBasedChannel): void {\n if (this.listeners(\"error\").length) {\n this.emit(\"error\", channel, error);\n } else {\n /* eslint-disable no-console */\n console.error(error);\n console.warn(\"Unhandled 'error' event.\");\n console.warn(\n \"See: https://distube.js.org/#/docs/DisTube/stable/class/DisTube?scrollTo=e-error and https://nodejs.org/api/events.html#events_error_events\",\n );\n /* eslint-enable no-console */\n }\n }\n}\n\nexport default DisTube;\n\n/**\n * Emitted after DisTube add a new playlist to the playing {@link Queue}.\n *\n * @event DisTube#addList\n * @param {Queue} queue The guild queue\n * @param {Playlist} playlist Playlist info\n * @example\n * distube.on(\"addList\", (queue, playlist) => queue.textChannel.send(\n * `Added \\`${playlist.name}\\` playlist (${playlist.songs.length} songs) to the queue!`\n * ));\n */\n\n/**\n * Emitted after DisTube add a new song to the playing {@link Queue}.\n *\n * @event DisTube#addSong\n * @param {Queue} queue The guild queue\n * @param {Song} song Added song\n * @example\n * distube.on(\"addSong\", (queue, song) => queue.textChannel.send(\n * `Added ${song.name} - \\`${song.formattedDuration}\\` to the queue by ${song.user}.`\n * ));\n */\n\n/**\n * Emitted when there is no user in the voice channel,\n * {@link DisTubeOptions}.leaveOnEmpty is `true` and there is a playing queue.\n *\n * If there is no playing queue (stopped and {@link DisTubeOptions}.leaveOnStop is `false`),\n * it will leave the channel without emitting this event.\n * @event DisTube#empty\n * @param {Queue} queue The guild queue\n * @example\n * distube.on(\"empty\", queue => queue.textChannel.send(\"Channel is empty. Leaving the channel\"))\n */\n\n/**\n * Emitted when DisTube encounters an error.\n *\n * @event DisTube#error\n * @param {Discord.BaseGuildTextChannel?} channel Text channel where the error is encountered.\n * @param {Error} error The error encountered\n * @example\n * distube.on('error', (channel, e) => {\n * if (channel) channel.send(`An error encountered: ${e}`)\n * else console.error(e)\n * })\n */\n\n/**\n * Emitted when there is no more song in the queue and {@link Queue#autoplay} is `false`.\n * DisTube will leave voice channel if {@link DisTubeOptions}.leaveOnFinish is `true`.\n *\n * @event DisTube#finish\n * @param {Queue} queue The guild queue\n * @example\n * distube.on(\"finish\", queue => queue.textChannel.send(\"No more song in queue\"));\n */\n\n/**\n * Emitted when DisTube initialize a queue to change queue default properties.\n *\n * @event DisTube#initQueue\n * @param {Queue} queue The guild queue\n * @example\n * distube.on(\"initQueue\", queue => {\n * queue.autoplay = false;\n * queue.volume = 100;\n * });\n */\n\n/**\n * Emitted when {@link Queue#autoplay} is `true`, {@link Queue#songs} is empty,\n * and DisTube cannot find related songs to play.\n *\n * @event DisTube#noRelated\n * @param {Queue} queue The guild queue\n * @example\n * distube.on(\"noRelated\", queue => queue.textChannel.send(\"Can't find related video to play.\"));\n */\n\n/**\n * Emitted when DisTube play a song.\n *\n * If {@link DisTubeOptions}.emitNewSongOnly is `true`,\n * this event is not emitted when looping a song or next song is the previous one.\n *\n * @event DisTube#playSong\n * @param {Queue} queue The guild queue\n * @param {Song} song Playing song\n * @example\n * distube.on(\"playSong\", (queue, song) => queue.textChannel.send(\n * `Playing \\`${song.name}\\` - \\`${song.formattedDuration}\\`\\nRequested by: ${song.user}`\n * ));\n */\n\n/**\n * Emitted when DisTube cannot find any results for the query.\n *\n * @event DisTube#searchNoResult\n * @param {Discord.Message} message The user message called play method\n * @param {string} query The search query\n * @example\n * distube.on(\"searchNoResult\", (message, query) => message.channel.send(`No result found for ${query}!`));\n */\n\n/**\n * Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,\n * and song param of {@link DisTube#play} is invalid url.\n * DisTube will wait for user's next message to choose a song manually.\n * <info>{@link https://support.google.com/youtube/answer/7354993|Safe search} is enabled\n * if {@link DisTubeOptions}.nsfw is disabled and the message's channel is not a nsfw channel.</info>\n *\n * @event DisTube#searchResult\n * @param {Discord.Message} message The user message called play method\n * @param {Array<SearchResult>} results Searched results\n * @param {string} query The search query\n * @example\n * // DisTubeOptions.searchSongs > 0\n * distube.on(\"searchResult\", (message, results) => {\n * message.channel.send(`**Choose an option from below**\\n${\n * results.map((song, i) => `**${i + 1}**. ${song.name} - \\`${song.formattedDuration}\\``).join(\"\\n\")\n * }\\n*Enter anything else or wait 60 seconds to cancel*`);\n * });\n */\n\n/**\n * Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,\n * and the search canceled due to {@link DisTubeOptions|DisTubeOptions.searchTimeout}.\n *\n * @event DisTube#searchCancel\n * @param {Discord.Message} message The user message called play method\n * @param {string} query The search query\n * @example\n * // DisTubeOptions.searchSongs > 0\n * distube.on(\"searchCancel\", (message) => message.channel.send(`Searching canceled`));\n */\n\n/**\n * Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,\n * and the search canceled due to user's next message is not a number or out of results range.\n *\n * @event DisTube#searchInvalidAnswer\n * @param {Discord.Message} message The user message called play method\n * @param {Discord.Message} answer The answered message of user\n * @param {string} query The search query\n * @example\n * // DisTubeOptions.searchSongs > 0\n * distube.on(\"searchInvalidAnswer\", (message) => message.channel.send(`You answered an invalid number!`));\n */\n\n/**\n * Emitted when {@link DisTubeOptions|DisTubeOptions.searchSongs} bigger than 0,\n * and after the user chose a search result to play.\n *\n * @event DisTube#searchDone\n * @param {Discord.Message} message The user message called play method\n * @param {Discord.Message} answer The answered message of user\n * @param {string} query The search query\n */\n\n/**\n * Emitted when the bot is disconnected to a voice channel.\n *\n * @event DisTube#disconnect\n * @param {Queue} queue The guild queue\n */\n\n/**\n * Emitted when a {@link Queue} is deleted with any reasons.\n *\n * @event DisTube#deleteQueue\n * @param {Queue} queue The guild queue\n */\n\n/**\n * Emitted when DisTube finished a song.\n *\n * @event DisTube#finishSong\n * @param {Queue} queue The guild queue\n * @param {Song} song Finished song\n */\n"]}
|
package/dist/constant.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Filters } from ".";
|
|
2
|
-
export declare const defaultFilters: Filters;
|
|
3
|
-
export declare const defaultOptions: {
|
|
4
|
-
plugins: never[];
|
|
5
|
-
emitNewSongOnly: boolean;
|
|
6
|
-
leaveOnEmpty: boolean;
|
|
7
|
-
leaveOnFinish: boolean;
|
|
8
|
-
leaveOnStop: boolean;
|
|
9
|
-
savePreviousSongs: boolean;
|
|
10
|
-
searchSongs: number;
|
|
11
|
-
ytdlOptions: {};
|
|
12
|
-
searchCooldown: number;
|
|
13
|
-
emptyCooldown: number;
|
|
14
|
-
nsfw: boolean;
|
|
15
|
-
emitAddSongWhenCreatingQueue: boolean;
|
|
16
|
-
emitAddListWhenCreatingQueue: boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare enum RepeatMode {
|
|
19
|
-
DISABLED = 0,
|
|
20
|
-
SONG = 1,
|
|
21
|
-
QUEUE = 2
|
|
22
|
-
}
|
|
23
|
-
export declare enum PluginType {
|
|
24
|
-
CUSTOM = "custom",
|
|
25
|
-
EXTRACTOR = "extractor"
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=constant.d.ts.map
|
package/dist/constant.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAkFjC,eAAO,MAAM,cAAc,EAAE,OAgB5B,CAAC;AA8BF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;CAc1B,CAAC;AASF,oBAAY,UAAU;IACpB,QAAQ,IAAA;IACR,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAQD,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB"}
|