mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 17:52:55 +00:00
Refactor getMessages to fetchMessages
This commit is contained in:
parent
ff3148ddd4
commit
e8c1c228d0
5 changed files with 7 additions and 7 deletions
File diff suppressed because one or more lines are too long
|
|
@ -55,7 +55,7 @@ class DMChannel extends Channel {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getMessages() {
|
fetchMessages() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ class GroupDMChannel extends Channel {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getMessages() {
|
fetchMessages() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class TextChannel extends GuildChannel {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getMessages() {
|
fetchMessages() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue