mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 01:13:17 +00:00
Customizing searchStation function in play.js
This commit is contained in:
parent
a36f3bf90d
commit
0ac8491a96
@ -172,15 +172,16 @@ function searchStation(key, client) {
|
||||
let foundStations = [];
|
||||
if (!key) return false;
|
||||
if (key == "radio") return false;
|
||||
/*client.stations
|
||||
|
||||
client.stations
|
||||
.filter(
|
||||
x => x.name.toUpperCase().includes(key.toUpperCase()) || x === key
|
||||
)
|
||||
.forEach(x =>
|
||||
foundStations.push({ station: x, name: x.name, probability: probabilityIncrement })
|
||||
);*/
|
||||
foundStations.push({ station: x, name: x.name, probability: 100 })
|
||||
);
|
||||
|
||||
//if (key.startsWith("radio ")) key = key.slice(6);
|
||||
if (key.startsWith("radio ")) key = key.slice(6);
|
||||
const probabilityIncrement = 100 / key.split(" ").length / 2;
|
||||
for (let i = 0; i < key.split(" ").length; i++) {
|
||||
client.stations
|
||||
|
Loading…
Reference in New Issue
Block a user