From 36bea7b5fff43e46c1781749ed71862ba20f34a9 Mon Sep 17 00:00:00 2001 From: Rapture <166316975+ftrapture@users.noreply.github.com> Date: Sun, 20 Oct 2024 22:56:34 +0530 Subject: [PATCH] Update spotify.js This will now accept 0 as a valid param, and assigned start and end initial values as 0 instead of null --- src/spotify.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spotify.js b/src/spotify.js index 3332662..ca76306 100644 --- a/src/spotify.js +++ b/src/spotify.js @@ -18,12 +18,12 @@ module.exports = class newSpotify { this.artist = null; this.border = null; this._bar_width = 1400; - this.end = null; + this.end = 0; this.overlay_opacity = null; this.image = null; this.blur = 3; this.title = null; - this.start = null; + this.start = 0; this.spotifyLogo = true; this.randomColors = ["#0c0c0c","#121212","#282828","#1c1c1c","#244c66"]; } @@ -156,8 +156,8 @@ module.exports = class newSpotify { * @example setTimestamp(40000,179000) */ setTimestamp(start, end) { - if (!start || typeof start !== "number") throw new Error("The first argument of the setTimestamp method must be a number."); - if (!end || typeof end !== "number") throw new Error("The first argument of the setTimestamp method must be a number."); + if (!start && start !== 0 || typeof start !== "number") throw new Error("The first argument of the setTimestamp method must be a number."); + if (!end && end !== 0 || typeof end !== "number") throw new Error("The first argument of the setTimestamp method must be a number."); this.start = start; this.end = end; return this;