diff --git a/client/src/modules/extmodule.js b/client/src/modules/extmodule.js new file mode 100644 index 00000000..b66e6c32 --- /dev/null +++ b/client/src/modules/extmodule.js @@ -0,0 +1,35 @@ +/** + * BetterDiscord External Module Base + * Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks + * All rights reserved. + * https://betterdiscord.net + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. +*/ + +export class ExtModule { + + constructor(pluginInternals) { + this.__pluginInternals = pluginInternals; + this.__require = window.require(this.paths.mainPath); + this.hasSettings = false; + } + + get type() { return 'module' } + get configs() { return this.__pluginInternals.configs } + get info() { return this.__pluginInternals.info } + get icon() { return this.info.icon } + get paths() { return this.__pluginInternals.paths } + get main() { return this.__pluginInternals.main } + get defaultConfig() { return this.configs.defaultConfig } + get userConfig() { return this.configs.userConfig } + get id() { return this.info.id || this.info.name.replace(/[^a-zA-Z0-9-]/g, '-').replace(/--/g, '-') } + get name() { return this.info.name } + get authors() { return this.info.authors } + get version() { return this.info.version } + get pluginPath() { return this.paths.contentPath } + get dirName() { return this.paths.dirName } + get enabled() { return true } + get pluginConfig() { return this.userConfig.config || [] } +} diff --git a/client/src/modules/extmodulemanager.js b/client/src/modules/extmodulemanager.js new file mode 100644 index 00000000..a3cc47a7 --- /dev/null +++ b/client/src/modules/extmodulemanager.js @@ -0,0 +1,20 @@ +/** + * BetterDiscord External Module Manager Module + * Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks + * All rights reserved. + * https://betterdiscord.net + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. +*/ + +import ContentManager from './contentmanager'; +import ExtModule from './extmodule'; +import PluginApi from './pluginapi'; +import Vendor from './vendor'; +import { ClientLogger as Logger } from 'common'; +import { Events } from 'modules'; + +export default class extends ContentManager { + +}