sanity changes to search (#1593)

* Create Search.js

* Create Guild.js

* Create TextBasedChannel.js

* Create Search.js

* Create Search.js

* Create Guild.js

* Create TextBasedChannel.js

* Create Search.js
This commit is contained in:
Gus Caplan
2017-06-24 17:23:45 -05:00
committed by Amish Shah
parent fd79539ec3
commit 7f8cc9c297
3 changed files with 21 additions and 12 deletions

View File

@@ -203,7 +203,7 @@ class TextBasedChannel {
* 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
* @returns {Promise<Array<Message[]>>}
* @returns {Promise<MessageSearchResult>}
* An array containing arrays of messages. Each inner array is a search context cluster
* The message which has triggered the result will have the `hit` property set to `true`
* @example
@@ -211,8 +211,8 @@ class TextBasedChannel {
* content: 'discord.js',
* before: '2016-11-17'
* }).then(res => {
* const hit = res.messages[0].find(m => m.hit).content;
* console.log(`I found: **${hit}**, total results: ${res.totalResults}`);
* const hit = res.results[0].find(m => m.hit).content;
* console.log(`I found: **${hit}**, total results: ${res.total}`);
* }).catch(console.error);
*/
search(options = {}) {