text: const { Extendable } = require('klasa');
  const { Guild } = require('discord.js');
  
  module.exports = class extends Extendable {
  	
  	constructor(...args) {
  		super(...args, { appliesTo: [Guild] });
  	}
  
  	/**
  	 * The guild level settings for this context (guild || default)
  	 * @since 0.5.0
  	 * @type {Settings}
  	 */
  	get settings() {
  		if (!this.client._guilds.get(this.id)) this.client._guilds.set(this.id, {});
  		if (!this.client._guilds.get(this.id).settings) this.client._guilds.get(this.id).settings = this.client.gateways.guilds.get(this.id, true, true);
  		if (this.client._guilds.get(this.id).settings) return this.client._guilds.get(this.id).settings;
  		return this.client._guilds.get(this.id).settings;
  	}
  
  	/**
  	 * The language configured for this guild
  	 * @type {?Language}
  	 */
  	get language() {
  		if (!this.client._guilds.get(this.id)) this.client._guilds.set(this.id, {});
  		return this.client.languages.get(this.settings.language) || null;
  	}
  
  	/**
  	 * Returns the JSON-compatible object of this instance.
  	 * @since 0.5.0
  	 * @returns {KlasaGuildJSON}
  	 */
  	toJSON() {
  		return { ...super.toJSON(), settings: this.settings.toJSON() };
  	}
  
  };
  