mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 21:12:06 +00:00
Fix empty search query parameters (#1119)
The search function was sending request to stuff like: search?author_id=&content=&channel_id=135823828352838352
This commit is contained in:
parent
c1a5bee61f
commit
5173583e26
1 changed files with 2 additions and 1 deletions
|
|
@ -165,8 +165,9 @@ class RESTMethods {
|
|||
|
||||
search(target, options) {
|
||||
options = transformSearchOptions(options, this.client);
|
||||
for (const key in options) if (options[key] === undefined) delete options[key];
|
||||
|
||||
const queryString = querystring.stringify(options);
|
||||
const queryString = (querystring.stringify(options).match(/[^=&?]+=[^=&?]+/g) || []).join('&');
|
||||
|
||||
let type;
|
||||
if (target instanceof Channel) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue