diff --git a/src/stores/MessageStore.js b/src/stores/MessageStore.js
index 52bf7fdd6..db72114f6 100644
--- a/src/stores/MessageStore.js
+++ b/src/stores/MessageStore.js
@@ -66,6 +66,7 @@ class MessageStore extends DataStore {
* 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.
+ * @param {boolean} [cache=true] Whether to cache the message(s)
* @returns {Promise>}
* @example
* // Get pinned messages
@@ -73,10 +74,10 @@ class MessageStore extends DataStore {
* .then(messages => console.log(`Received ${messages.size} messages`))
* .catch(console.error);
*/
- fetchPinned() {
+ fetchPinned(cache = true) {
return this.client.api.channels[this.channel.id].pins.get().then(data => {
const messages = new Collection();
- for (const message of data) messages.set(message.id, this.add(message));
+ for (const message of data) messages.set(message.id, this.add(message, cache));
return messages;
});
}
diff --git a/typings/index.d.ts b/typings/index.d.ts
index 3f9f222af..e1a6bac84 100644
--- a/typings/index.d.ts
+++ b/typings/index.d.ts
@@ -1366,9 +1366,9 @@ declare module 'discord.js' {
export class MessageStore extends DataStore {
constructor(channel: TextChannel | DMChannel, iterable?: Iterable);
- public fetch(message: Snowflake): Promise;
- public fetch(options?: ChannelLogsQueryOptions): Promise>;
- public fetchPinned(): Promise>;
+ public fetch(message: Snowflake, cache?: boolean): Promise;
+ public fetch(options?: ChannelLogsQueryOptions, cache?: boolean): Promise>;
+ public fetchPinned(cache?: boolean): Promise>;
}
export class PresenceStore extends DataStore {