text: //META{"name":"{{PLUGIN_NAME}}","displayName":"{{PLUGIN_NAME}}","website":"{{WEBSITE}}","source":"{{SOURCE}}"}*//
  {{INSTALL_SCRIPT}}
  var {{PLUGIN_NAME}} = (() => {
  	if (!global.ZLibrary && !global.ZLibraryPromise) global.ZLibraryPromise = new Promise((resolve, reject) => {
  		require("request").get({url: "https://rauenzi.github.io/BDPluginLibrary/release/ZLibrary.js", timeout: 10000}, (err, res, body) => {
  			if (err || 200 !== res.statusCode) return reject(err || res.statusMessage);
  			try {const vm = require("vm"), script = new vm.Script(body, {displayErrors: true}); resolve(script.runInThisContext());}
  			catch(err) {reject(err);}
  		});
  	});
  	const config = {{CONFIG}};
  	const compilePlugin = ([Plugin, Api]) => {
  		const plugin = {{INNER}};
  		return plugin(Plugin, Api);
  	};
  	
  	return !global.ZLibrary ? class {
  		getName() {return config.info.name.replace(" ", "");} getAuthor() {return config.info.authors.map(a => a.name).join(", ");} getDescription() {return config.info.description;} getVersion() {return config.info.version;} stop() {}
  		showAlert() {window.BdApi.alert("Loading Error",`Something went wrong trying to load the library for the plugin. You can try using a local copy of the library to fix this.<br /><br /><a href="https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js" target="_blank">Click here to download the library!</a>`);}
  		async load() {
  			try {await global.ZLibraryPromise;}
  			catch(err) {return this.showAlert();}
  			const vm = require("vm"), plugin = compilePlugin(global.ZLibrary.buildPlugin(config));
  			try {new vm.Script(plugin, {displayErrors: true});} catch(err) {return bdpluginErrors.push({name: this.getName(), file: this.getName() + ".plugin.js", reason: "Plugin could not be compiled.", error: {message: err.message, stack: err.stack}});}
  			global[this.getName()] = plugin;
  			try {new vm.Script(`new global["${this.getName()}"]();`, {displayErrors: true});} catch(err) {return bdpluginErrors.push({name: this.getName(), file: this.getName() + ".plugin.js", reason: "Plugin could not be constructed", error: {message: err.message, stack: err.stack}});}
  			bdplugins[this.getName()].plugin = new global[this.getName()]();
  			bdplugins[this.getName()].plugin.load();
  		}
  		async start() {
  			try {await global.ZLibraryPromise;}
  			catch(err) {return this.showAlert();}
  			bdplugins[this.getName()].plugin.start();
  		}
  	} : compilePlugin(global.ZLibrary.buildPlugin(config));
  })();