mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01: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:
@@ -165,8 +165,9 @@ class RESTMethods {
|
|||||||
|
|
||||||
search(target, options) {
|
search(target, options) {
|
||||||
options = transformSearchOptions(options, this.client);
|
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;
|
let type;
|
||||||
if (target instanceof Channel) {
|
if (target instanceof Channel) {
|
||||||
|
|||||||
Reference in New Issue
Block a user