From 5cce9987392401719a8ff10a9fbee1753b5ff41e Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Wed, 20 Jul 2022 12:55:01 +0545 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=81=20Example=20submodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 2 +- .gitignore | 6 ------ .gitmodules | 3 +++ examples/README.md | 3 +++ examples/music-bot | 1 + src/Player.ts | 4 ++-- src/types/types.ts | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 .gitmodules create mode 100644 examples/README.md create mode 160000 examples/music-bot diff --git a/.eslintignore b/.eslintignore index 525c1ac..ddb4f13 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,4 @@ -example/ +examples/ node_modules/ dist/ .github/ diff --git a/.gitignore b/.gitignore index 3066088..c03255f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,4 @@ dist # Yarn logs yarn*.log -# example -example/test -example/music-bot/node_modules -example/music-bot/package-lock.json -example/music-bot/.env - dev/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4c0292a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "examples/music-bot"] + path = examples/music-bot + url = https://github.com/Androz2091/discord-music-bot diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..50e879d --- /dev/null +++ b/examples/README.md @@ -0,0 +1,3 @@ +# Discord Player Examples + +Examples for **[discord-player](https://github.com/Androz2091/discord-player)**. \ No newline at end of file diff --git a/examples/music-bot b/examples/music-bot new file mode 160000 index 0000000..cae67e4 --- /dev/null +++ b/examples/music-bot @@ -0,0 +1 @@ +Subproject commit cae67e4e466b5884435572b9968859bc88220408 diff --git a/src/Player.ts b/src/Player.ts index e1398a6..117de20 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -415,9 +415,9 @@ class Player extends EventEmitter { const data = new Track(this, { title: m.track.name ?? "", description: m.track.description ?? "", - author: m.track.artists[0]?.name ?? "Unknown Artist", + author: m.track.artists?.[0]?.name ?? "Unknown Artist", url: m.track.external_urls?.spotify ?? query, - thumbnail: m.track.album?.images[0]?.url ?? "https://www.scdn.co/i/_global/twitter_card-default.jpg", + thumbnail: m.track.album?.images?.[0]?.url ?? "https://www.scdn.co/i/_global/twitter_card-default.jpg", duration: Util.buildTimeCode(Util.parseMS(m.track.duration_ms)), views: 0, requestedBy: options.requestedBy as User, diff --git a/src/types/types.ts b/src/types/types.ts index 961da54..fbd45ed 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -136,7 +136,7 @@ export interface PlayerProgressbarOptions { * @property {number} [bufferingTimeout=3000] Buffering timeout for the stream * @property {boolean} [spotifyBridge=true] If player should bridge spotify source to youtube * @property {boolean} [disableVolume=false] If player should disable inline volume - * @property {boolean} [volumeSmoothness=0] The volume transition smoothness between volume changes (lower the value to get better result) + * @property {number} [volumeSmoothness=0] The volume transition smoothness between volume changes (lower the value to get better result) * Setting this or leaving this empty will disable this effect. Example: `volumeSmoothness: 0.1` * @property {Function} [onBeforeCreateStream] Runs before creating stream */