diff --git a/src/stores/MessageStore.js b/src/stores/MessageStore.js index 852f4ebe5..07b85ea87 100644 --- a/src/stores/MessageStore.js +++ b/src/stores/MessageStore.js @@ -36,6 +36,8 @@ class MessageStore extends DataStore { /** * Gets a message, or messages, from this channel. + * 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 {Snowflake|ChannelLogsQueryOptions} [message] The ID of the message to fetch, or query parameters. * @returns {Promise|Promise>} * @example @@ -48,6 +50,11 @@ class MessageStore extends DataStore { * channel.messages.fetch({ limit: 10 }) * .then(messages => console.log(`Received ${messages.size} messages`)) * .catch(console.error); + * @example + * // Get messages and filter by user ID + * channel.messages.fetch() + * .then(messages => console.log(`${messages.filter(m => m.author.id === '84484653687267328').size} messages`)) + * .catch(console.error); */ fetch(message) { return typeof message === 'string' ? this._fetchId(message) : this._fetchMany(message); @@ -55,9 +62,14 @@ class MessageStore extends DataStore { /** * Fetches the pinned messages of this channel and returns a collection of them. - * The returned Collection does not contain the reactions of the messages. + * 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.fetchPinned() + * .then(messages => console.log(`Received ${messages.size} messages`)) + * .catch(console.error); */ fetchPinned() { return this.client.api.channels[this.channel.id].pins.get().then(data => { diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 45e952617..97a28681b 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -178,7 +178,7 @@ class GuildChannel extends Channel { } /** - * Updates the permission overwrites for a channel + * Replaces the permission overwrites in this channel. * @param {Object} [options] Options * @param {Array} [options.overwrites] Permission overwrites * @param {string} [options.reason] Reason for updating the channel overwrites