mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Made search argument optional, added useronly warning and fixed endpoint (#1407)
This commit is contained in:
@@ -444,6 +444,7 @@ class Guild {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a search within the entire guild.
|
* Performs a search within the entire guild.
|
||||||
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @param {MessageSearchOptions} [options={}] Options to pass to the search
|
* @param {MessageSearchOptions} [options={}] Options to pass to the search
|
||||||
* @returns {Promise<Array<Message[]>>}
|
* @returns {Promise<Array<Message[]>>}
|
||||||
* An array containing arrays of messages. Each inner array is a search context cluster.
|
* An array containing arrays of messages. Each inner array is a search context cluster.
|
||||||
@@ -457,7 +458,7 @@ class Guild {
|
|||||||
* console.log(`I found: **${hit}**, total results: ${res.totalResults}`);
|
* console.log(`I found: **${hit}**, total results: ${res.totalResults}`);
|
||||||
* }).catch(console.error);
|
* }).catch(console.error);
|
||||||
*/
|
*/
|
||||||
search(options) {
|
search(options = {}) {
|
||||||
return this.client.rest.methods.search(this, options);
|
return this.client.rest.methods.search(this, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,7 @@ class TextBasedChannel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a search within the channel.
|
* Performs a search within the channel.
|
||||||
|
* <warn>This is only available when using a user account.</warn>
|
||||||
* @param {MessageSearchOptions} [options={}] Options to pass to the search
|
* @param {MessageSearchOptions} [options={}] Options to pass to the search
|
||||||
* @returns {Promise<Array<Message[]>>}
|
* @returns {Promise<Array<Message[]>>}
|
||||||
* An array containing arrays of messages. Each inner array is a search context cluster.
|
* An array containing arrays of messages. Each inner array is a search context cluster.
|
||||||
@@ -231,7 +232,7 @@ class TextBasedChannel {
|
|||||||
* console.log(`I found: **${hit}**, total results: ${res.totalResults}`);
|
* console.log(`I found: **${hit}**, total results: ${res.totalResults}`);
|
||||||
* }).catch(console.error);
|
* }).catch(console.error);
|
||||||
*/
|
*/
|
||||||
search(options) {
|
search(options = {}) {
|
||||||
return this.client.rest.methods.search(this, options);
|
return this.client.rest.methods.search(this, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ const Endpoints = exports.Endpoints = {
|
|||||||
typing: `${base}/typing`,
|
typing: `${base}/typing`,
|
||||||
permissions: `${base}/permissions`,
|
permissions: `${base}/permissions`,
|
||||||
webhooks: `${base}/webhooks`,
|
webhooks: `${base}/webhooks`,
|
||||||
search: `${base}/search`,
|
search: `${base}/messages/search`,
|
||||||
ack: `${base}/ack`,
|
ack: `${base}/ack`,
|
||||||
pins: `${base}/pins`,
|
pins: `${base}/pins`,
|
||||||
Pin: messageID => `${base}/pins/${messageID}`,
|
Pin: messageID => `${base}/pins/${messageID}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user