docs: consistency

This commit is contained in:
Lewdcario
2018-04-29 13:28:12 -05:00
parent 5acf4061e8
commit 745669a7c9
8 changed files with 18 additions and 22 deletions

View File

@@ -558,8 +558,8 @@ class GuildChannel extends Channel {
* @example
* // Delete the channel
* channel.delete('making room for new channels')
* .then() // Success
* .catch(console.error); // Log error
* .then(console.log)
* .catch(console.error);
*/
delete(reason) {
return this.client.api.channels(this.id).delete({ reason }).then(() => this);

View File

@@ -125,8 +125,7 @@ class Webhook {
* .then(console.log)
* .catch(console.error);
*/
/* eslint-enable max-len */
async send(content, options) { // eslint-disable-line complexity
async send(content, options) {
if (!options && typeof content === 'object' && !(content instanceof Array)) {
options = content;
content = null;

View File

@@ -125,13 +125,12 @@ class TextBasedChannel {
* @param {MessageSearchOptions} [options={}] Options to pass to the search
* @returns {Promise<MessageSearchResult>}
* @example
* channel.search({
* content: 'discord.js',
* before: '2016-11-17'
* }).then(res => {
* const hit = res.results[0].find(m => m.hit).content;
* console.log(`I found: **${hit}**, total results: ${res.total}`);
* }).catch(console.error);
* channel.search({ content: 'discord.js', before: '2016-11-17' })
* .then(res => {
* const hit = res.results[0].find(m => m.hit).content;
* console.log(`I found: **${hit}**, total results: ${res.total}`);
* })
* .catch(console.error);
*/
search(options = {}) {
return Shared.search(this, options);