Bases
This commit is contained in:
parent
69e10f69cd
commit
32e563effc
|
@ -27,6 +27,12 @@ class Module {
|
|||
if (this.setInitialState) this.setInitialState(this.state);
|
||||
}
|
||||
|
||||
setState(newState) {
|
||||
const oldState = this.state;
|
||||
Object.assign(this.state, newState);
|
||||
if (this.stateChanged) this.stateChanged(oldState, newState);
|
||||
}
|
||||
|
||||
set args(t) { }
|
||||
get args() { return this.__.args; }
|
||||
get state() { return this.__.state; }
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* BetterDiscord Plugin Base Class
|
||||
* Copyright (c) 2015-present JsSucks - https://github.com/JsSucks
|
||||
* All rights reserved.
|
||||
* https://github.com/JsSucks - 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.
|
||||
*/
|
||||
|
||||
class Plugin {
|
||||
|
||||
constructor() {}
|
||||
|
||||
}
|
||||
|
||||
module.exports = { Plugin }
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* BetterDiscord Plugin Manager
|
||||
* Copyright (c) 2015-present JsSucks - https://github.com/JsSucks
|
||||
* All rights reserved.
|
||||
* https://github.com/JsSucks - 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.
|
||||
*/
|
||||
|
||||
const { Module } = require('./modulebase');
|
||||
|
||||
class PluginManager extends Module {
|
||||
|
||||
setInitialState() {
|
||||
this.setState({
|
||||
plugins: {}
|
||||
});
|
||||
}
|
||||
|
||||
get plugins() {
|
||||
return this.state.plugins;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = { PluginManager }
|
Loading…
Reference in New Issue