mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
Refactor getMessages to fetchMessages
This commit is contained in:
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');
|
||||||
|
|||||||
Reference in New Issue
Block a user