Skip to content

Commit

Permalink
fix(Webhook#send): incorrect docs + return
Browse files Browse the repository at this point in the history
Two things:
* Documentation doesn't account for possible raw object return
* Allows the return to be a Message object as well, like the docs originally intended
  • Loading branch information
Lewdcario committed Jan 24, 2018
1 parent 8df1ac9 commit e978253
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/client/rest/RESTMethods.js
Expand Up @@ -806,7 +806,10 @@ class RESTMethods {
content,
tts,
embeds,
}, files).then(resolve, reject);
}, files).then(data => {
if (!this.client.channels) resolve(data);
else resolve(this.client.actions.MessageCreate.handle(data).message);
}, reject);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Webhook.js
Expand Up @@ -95,7 +95,7 @@ class Webhook {
* @param {StringResolvable} content The content to send
* @param {WebhookMessageOptions|Attachment|RichEmbed} [options] The options to provide
* can also be just a RichEmbed or Attachment
* @returns {Promise<Message|Message[]>}
* @returns {Promise<Message|Message[]|Object|Object[]>}
* @example
* // Send a message
* webhook.send('hello!')
Expand Down

0 comments on commit e978253

Please sign in to comment.