diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index 6938d12b2..a44f644e7 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -200,6 +200,8 @@ class TextBasedChannel { /** * Gets the past messages sent in this channel. Resolves with a collection mapping message ID's to Message objects. + * The returned Collection does not contain reaction users of the messages if they were not cached. + * Those need to be fetched separately in such a case. * @param {ChannelLogsQueryOptions} [options={}] Query parameters to pass in * @returns {Promise>} * @example @@ -207,6 +209,11 @@ class TextBasedChannel { * channel.fetchMessages({ limit: 10 }) * .then(messages => console.log(`Received ${messages.size} messages`)) * .catch(console.error); + * @example + * // Get messages and filter by user ID + * channel.fetchMessages() + * .then(messages => console.log(`${messages.filter(m => m.author.id === '84484653687267328').size} messages`)) + * .catch(console.error); */ fetchMessages(options = {}) { return this.client.rest.methods.getChannelMessages(this, options).then(data => { @@ -222,7 +229,14 @@ class TextBasedChannel { /** * Fetches the pinned messages of this channel and returns a collection of them. + * The returned Collection does not contain any reaction data of the messages. + * Those need to be fetched separately. * @returns {Promise>} + * @example + * // Get pinned messages + * channel.fetchPinnedMessages() + * .then(messages => console.log(`Received ${messages.size} messages`)) + * .catch(console.error); */ fetchPinnedMessages() { return this.client.rest.methods.getChannelPinnedMessages(this).then(data => {