├── .gitignore
├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── src
├── index.ts
├── builders
│ └── FilterBuilder.ts
├── structures
│ ├── Queue.ts
│ ├── Utils.ts
│ ├── Node.ts
│ ├── Player.ts
│ └── Manager.ts
└── data
│ └── filters.ts
├── tsconfig.json
├── package.json
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: ['https://qiwi.com/n/BLEACHNODES']
2 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./structures/Manager";
2 | export * from "./structures/Node";
3 | export * from "./structures/Player";
4 | export * from "./structures/Queue";
5 | export * from "./structures/Utils";
6 | export * from "./data/filters";
7 | export * from "./builders/FilterBuilder";
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Basic Options */
4 | "target": "ES2022",
5 | "module": "CommonJS",
6 | "declaration": true,
7 | "outDir": "./dist",
8 | "rootDir": "./src",
9 | "skipLibCheck": true,
10 | "importHelpers": true,
11 |
12 | /* Strict Type-Checking Options */
13 | // "strict": true,
14 | // "noImplicitAny": true,
15 | // "strictNullChecks": true,
16 | // "strictFunctionTypes": true,
17 | // "strictBindCallApply": true,
18 | // "strictPropertyInitialization": true,
19 | // "noImplicitThis": true,
20 | // "alwaysStrict": true,
21 |
22 | /* Additional Checks */
23 | // "noUnusedLocals": true,
24 | // "noUnusedParameters": true,
25 | // "noImplicitReturns": true,
26 | // "noFallthroughCasesInSwitch": true,
27 |
28 | /* Module Resolution Options */
29 | "moduleResolution": "node",
30 | "esModuleInterop": true
31 | },
32 | "exclude": ["node_modules", "dist"]
33 | }
34 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lavacat",
3 | "version": "0.0.1",
4 | "description": "An easy-to-use Lavalink client for NodeJS.",
5 | "main": "dist/index.js",
6 | "types": "dist/index.d.ts",
7 | "files": [ "dist" ],
8 | "scripts": {
9 | "build": "tsc",
10 | "types": "rtb --dist dist",
11 | "lint": "eslint --ext .ts ./src",
12 | "docs": "typedoc --json ./docs.json --mode file --excludeProtected --excludePrivate --excludeExternals src/structures",
13 | "publish:stable": "yarn build && yarn types && yarn publish --access=public",
14 | "publish:beta": "yarn build && yarn types && yarn publish --tag beta --access=public",
15 | "ci": "run-s lint build types"
16 | },
17 | "keywords": [
18 | "lavalink",
19 | "discord",
20 | "music",
21 | "bot",
22 | "discord.js",
23 | "eris",
24 | "lavacat"
25 | ],
26 | "author": "CatLegend",
27 | "contributors": [],
28 | "license": "Apache-2.0",
29 | "repository": "BleachStudio/LavaCat",
30 | "bugs": "https://github.com/BleachStudio/LavaCat",
31 | "devDependencies": {
32 | "@favware/rollup-type-bundler": "^1.0.11",
33 | "@types/node": "v16",
34 | "@types/ws": "^8.5.3",
35 | "@typescript-eslint/eslint-plugin": "^5.37.0",
36 | "@typescript-eslint/parser": "^5.37.0",
37 | "eslint": "^8.23.1",
38 | "npm-run-all": "^4.1.5",
39 | "typedoc": "^0.23.14",
40 | "typedoc-plugin-no-inherit": "^1.4.0",
41 | "typescript": "^4.8.3"
42 | },
43 | "dependencies": {
44 | "@discordjs/collection": "^1.1.0",
45 | "tslib": "^2.4.0",
46 | "undici": "^5.10.0",
47 | "ws": "^8.8.1"
48 | },
49 | "engines": {
50 | "node": ">=16.0.0"
51 | },
52 | "eslintConfig": {
53 | "root": true,
54 | "parser": "@typescript-eslint/parser",
55 | "plugins": [
56 | "@typescript-eslint"
57 | ],
58 | "rules": {
59 | "object-curly-spacing": [
60 | "error",
61 | "always"
62 | ]
63 | },
64 | "extends": [
65 | "eslint:recommended",
66 | "plugin:@typescript-eslint/recommended"
67 | ]
68 | },
69 | "homepage": "https://github.com/BleachStudio/LavaCat#readme"
70 | }
71 |
--------------------------------------------------------------------------------
/src/builders/FilterBuilder.ts:
--------------------------------------------------------------------------------
1 | import { Filter } from "../data/filters";
2 |
3 | export class FilterBuilder {
4 | public name: string = 'CUSTOM';
5 | public data: Filter = {};
6 |
7 | constructor(options?: Filter) {
8 | if (options) {
9 | this.data = options
10 | }
11 | };
12 |
13 | /**
14 | * setName
15 | */
16 | public setName(name: string) {
17 | this.name = name;
18 |
19 | return this;
20 | };
21 |
22 | /**
23 | * setEQ
24 | */
25 | public setEQ(options: Filter['equalizer']) {
26 | this.data['equalizer'] = options;
27 |
28 | return this;
29 | };
30 |
31 | /**
32 | * setKaraoke
33 | */
34 | public setKaraoke(options: Filter['karaoke']) {
35 | this.data['karaoke'] = options;
36 |
37 | return this;
38 | };
39 |
40 | /**
41 | * setTimescale
42 | */
43 | public setTimescale(options: Filter['timescale']) {
44 | this.data['timescale'] = options;
45 |
46 | return this;
47 | };
48 |
49 | /**
50 | * setTremolo
51 | */
52 | public setTremolo(options: Filter['tremolo']) {
53 | this.data['tremolo'] = options;
54 |
55 | return this;
56 | };
57 |
58 | /**
59 | * setVibrato
60 | */
61 | public setVibrato(options: Filter['vibrato']) {
62 | this.data['vibrato'] = options;
63 |
64 | return this;
65 | };
66 |
67 | /**
68 | * setRotation
69 | */
70 | public setRotation(options: Filter['rotation']) {
71 | this.data['rotation'] = options;
72 |
73 | return this;
74 | };
75 |
76 | /**
77 | * setDistortion
78 | */
79 | public setDistortion(options: Filter['distortion']) {
80 | this.data['distortion'] = options;
81 |
82 | return this;
83 | };
84 |
85 | /**
86 | * setChannelMix
87 | */
88 | public setChannelMix(options: Filter['channelMix']) {
89 | this.data['channelMix'] = options;
90 |
91 | return this;
92 | };
93 |
94 | /**
95 | * setLowPass
96 | */
97 | public setLowPass(options: Filter['lowPass']) {
98 | this.data['lowPass'] = options;
99 |
100 | return this;
101 | };
102 | };
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
23 |
24 | ## Documentation & Guides
25 |
26 | - [Documentation](https://lavacat.xyz "LavaCat Documentation")
27 |
28 | - [Guides](https://lavacat.xyz/guides "LavaCat Guides")
29 |
30 | ## Prerequisites
31 |
32 | - Java - [Azul](https://www.azul.com/downloads/zulu-community/?architecture=x86-64-bit&package=jdk "Download Azul OpenJDK"), [Adopt](https://adoptopenjdk.net/ "Download Adopt OpenJDK") or [sdkman](https://sdkman.io/install "Download sdkman")
33 |
34 | - [Lavalink](https://ci.fredboat.com/viewLog.html?buildId=lastSuccessful&buildTypeId=Lavalink_Build&tab=artifacts&guest=1 "Download Lavalink")
35 |
36 | - ### Lavalink plugins:
37 | - [LavaSRC](https://ci.fredboat.com/viewLog.html?buildId=lastSuccessful&buildTypeId=Lavalink_Build&tab=artifacts&guest=1 "Install plugin")
38 | - [Lavalink](https://ci.fredboat.com/viewLog.html?buildId=lastSuccessful&buildTypeId=Lavalink_Build&tab=artifacts&guest=1 "Download Lavalink")
39 |
40 | **Note**: _Java v11 or newer is required to run the Lavalink.jar. Java v13 is recommended._ If you are using **sdkman** then _its a manager, not Java, you have to install sdkman and use sdkman to install Java_
41 |
42 | **Warning**: Java v14 has issues with Lavalink.
43 |
44 | ## Installation
45 |
46 | ##### **NPM**
47 |
48 | ```bash
49 | npm install lavacat
50 | ```
51 |
52 | ##### **Yarn**
53 |
54 | ```bash
55 | yarn add lavacat
56 | ```
57 |
58 | **Note**: _Node **v16** is required!_
59 |
60 | ## Getting Started
61 |
62 | - Create an application.yml file in your working directory and copy the [example](https://github.com/freyacodes/Lavalink/blob/master/LavalinkServer/application.yml.example "application.yml file") into the created file and edit it with your configuration.
63 |
64 | - Run the jar file by running `java -jar Lavalink.jar` in a Terminal window.
65 |
66 | ## Example usage
67 |
68 | Please read the guides to start:
69 |
--------------------------------------------------------------------------------
/src/structures/Queue.ts:
--------------------------------------------------------------------------------
1 | import { Track, UnresolvedTrack } from "./Player";
2 | import { TrackUtils } from "./Utils";
3 |
4 | /**
5 | * The player's queue, the `current` property is the currently playing track, think of the rest as the up-coming tracks.
6 | * @noInheritDoc
7 | */
8 | export class Queue extends Array