MenuDocs/erela.js-spotify

TypeError: finalQuery.match is not a function

FredTheNoob opened this issue · 2 comments

When searching with my manager I get this error:

image

Whoops. It would seem that the search requires a string specifically. I was passing an array, as I was able to without the plugin.

Playing around I was able to recreate this by passing a falsy value in the query property etc:

manager.search({ query: "" })

This is because the transpiled code is this:

const finalQuery = query.query || query;

If the query property is false it will use the right hand side which is the object and the object does not have a match function in it. A fix would be checking if the user provides a valid value inside of Erela itself.