From f1184c6e0d513d9283a4ef234b2b1e2b05c9862b Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Wed, 11 Mar 2020 23:11:00 +0200 Subject: [PATCH] stations --- commands/play.js | 2 +- struct/funcs/searchStation.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/play.js b/commands/play.js index e1ae10a..635d91c 100644 --- a/commands/play.js +++ b/commands/play.js @@ -35,7 +35,7 @@ module.exports = { } } else { const sstation = await client.funcs.searchStation(args.slice(1).join(' '), client); - if (sstation === false) return msg.channel.send('No stations found!'); + if (!sstation) return msg.channel.send('No stations found!'); url = sstation.stream[sstation.stream.default]; station = sstation } diff --git a/struct/funcs/searchStation.js b/struct/funcs/searchStation.js index 716cd2b..a035c4a 100644 --- a/struct/funcs/searchStation.js +++ b/struct/funcs/searchStation.js @@ -1,4 +1,5 @@ module.exports = function (key, client) { + if (client.stations === null) return false; let foundStations = []; if (!key) return false; const probabilityIncrement = 100 / key.split(' ').length / 2;