Refactor getMessages to fetchMessages

This commit is contained in:
Amish Shah
2016-08-31 21:34:43 +01:00
parent ff3148ddd4
commit e8c1c228d0
5 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -55,7 +55,7 @@ class DMChannel extends Channel {
return; return;
} }
getMessages() { fetchMessages() {
return; return;
} }

View File

@@ -132,7 +132,7 @@ class GroupDMChannel extends Channel {
return; return;
} }
getMessages() { fetchMessages() {
return; return;
} }

View File

@@ -40,7 +40,7 @@ class TextChannel extends GuildChannel {
return; return;
} }
getMessages() { fetchMessages() {
return; return;
} }

View File

@@ -235,11 +235,11 @@ class TextBasedChannel {
* @returns {Promise<Collection<String, Message>, Error>} * @returns {Promise<Collection<String, Message>, Error>}
* @example * @example
* // get messages * // get messages
* channel.getMessages({limit: 10}) * channel.fetchMessages({limit: 10})
* .then(messages => console.log(`Received ${messages.size} messages`)) * .then(messages => console.log(`Received ${messages.size} messages`))
* .catch(console.log); * .catch(console.log);
*/ */
getMessages(options = {}) { fetchMessages(options = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.client.rest.methods.getChannelMessages(this, options) this.client.rest.methods.getChannelMessages(this, options)
.then(data => { .then(data => {
@@ -363,7 +363,7 @@ exports.applyToClass = (structure, full = false) => {
const props = ['sendMessage', 'sendTTSMessage', 'sendFile']; const props = ['sendMessage', 'sendTTSMessage', 'sendFile'];
if (full) { if (full) {
props.push('_cacheMessage'); props.push('_cacheMessage');
props.push('getMessages'); props.push('fetchMessages');
props.push('bulkDelete'); props.push('bulkDelete');
props.push('setTyping'); props.push('setTyping');
props.push('fetchPinnedMessages'); props.push('fetchPinnedMessages');