mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Datastore cleanup (#1892)
* Start Store cleanup * wip store cleanup * fix iterables initiating datastores * handle the possibility of a datastore with no holds and no its own 'create' method * more cleanup (instances that need more than just client/data) * missed RoleStore extras * not sure how eslint didn't catch that tab... * avoid re-getting the channel we already have... * cleanup resolvers and refactor them into DataStores * ^ * and remove * fix some bugs * fix lint * fix documentation maybe? * formatting * fix presences * really fix presences this time * bad fix was bad... let;s see how bad this one is.. * forgot to save a file * make presence resolving take userresolveables too * fix tabs in jsdocs * fix bad fix from last night that caused issues, with better fix... * oops
This commit is contained in:
@@ -16,7 +16,7 @@ class ChannelStore extends DataStore {
|
||||
options = iterableOrOptions;
|
||||
iterableOrOptions = undefined;
|
||||
}
|
||||
super(client, iterableOrOptions);
|
||||
super(client, iterableOrOptions, Channel);
|
||||
|
||||
if (options.lru) {
|
||||
const lru = this[kLru] = [];
|
||||
@@ -72,6 +72,29 @@ class ChannelStore extends DataStore {
|
||||
if (channel.guild) channel.guild.channels.remove(id);
|
||||
super.remove(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data that can be resolved to give a Channel object. This can be:
|
||||
* * A Channel object
|
||||
* * A Snowflake
|
||||
* @typedef {Channel|Snowflake} ChannelResolvable
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resolves a ChannelResolvable to a Channel object.
|
||||
* @method resolve
|
||||
* @memberof ChannelStore
|
||||
* @param {ChannelResolvable} channel The channel resolvable to resolve
|
||||
* @returns {?Channel}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Resolves a ChannelResolvable to a channel ID string.
|
||||
* @method resolveID
|
||||
* @memberof ChannelStore
|
||||
* @param {ChannelResolvable} channel The channel resolvable to resolve
|
||||
* @returns {?string}
|
||||
*/
|
||||
}
|
||||
|
||||
module.exports = ChannelStore;
|
||||
|
||||
Reference in New Issue
Block a user