class CacheManager {

	constructor(client) {
		this.cacheEngine = client.config.provider.cache || 'js';
		this.data = this.cacheEngine === 'js' ? new client.methods.Collection() : client.providers.get(this.cacheEngine);
	}

	get(guild) {
		if (this.cacheEngine === 'js') return this.data.get(guild);
		return this.data.get('guilds', guild);
	}

	getAll() {
		if (this.cacheEngine === 'js') return this.data;
		return this.data.getAll('guilds');
	}

	set(guild, data) {
		if (this.cacheEngine === 'js') return this.data.set(guild, data);
		return this.data.set('guilds', guild, data);
	}

	delete(guild) {
		if (this.cacheEngine === 'js') return this.data.delete(guild);
		return this.data.delete('guilds', guild);
	}

}

module.exports = CacheManager;

@@ -1,25 +1,119 @@
-class CacheManager %7B%0A
+/**%0A * Manages the local cache%0A */%0Aclass CacheManager %7B%0A%0A%09/**%0A%09 * @param %7BKlasaClient%7D client The Klasa client%0A%09 */
 %0A%09co
@@ -307,24 +307,148 @@
 ngine);%0A%09%7D%0A%0A
+%09/**%0A%09 * Gets a guild from cache%0A%09 * @param %7Bstring%7D guild The guild id%0A%09 * @returns %7BObject%7D The guild setting object%0A%09 */%0A
 %09get(guild) 
@@ -556,16 +556,107 @@
 d);%0A%09%7D%0A%0A
+%09/**%0A%09 * Gets all guilds from cache%0A%09 * @returns %7BObject%5B%5D%7D All guild setting objects%0A%09 */%0A
 %09getAll(
@@ -751,16 +751,176 @@
 ');%0A%09%7D%0A%0A
+%09/**%0A%09 * Sets a guild setting object to cache%0A%09 * @param %7Bstring%7D guild The guild id%0A%09 * @param %7BObject%7D data The guild setting object%0A%09 * @returns %7Bvoid%7D%0A%09 */%0A
 %09set(gui
@@ -1050,16 +1050,116 @@
 a);%0A%09%7D%0A%0A
+%09/**%0A%09 * Deletes a guild from cache%0A%09 * @param %7Bstring%7D guild The guild id%0A%09 * @returns %7Bvoid%7D%0A%09 */%0A
 %09delete(

document cachemanager