mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[PCCompat] Use powercord import instead of window global
This commit is contained in:
parent
ac3778e574
commit
d94d7bfc42
2 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
// Also set Powercord global var stuff here since entities import is needed to use Plugin (which every PC plugin uses)
|
||||
|
||||
window.powercord = {
|
||||
export const powercord = {
|
||||
api: {
|
||||
commands: {
|
||||
registerCommand: ({ command, alias, description, usage, executor }) => {
|
||||
|
|
|
@ -19,7 +19,7 @@ export default (manifestPath, repo) => {
|
|||
|
||||
const content = readFileSync(pcManifest.main || 'index.js', 'utf8');//.replace(/\\/g, '\\\\').replace(/`/g, '\\`');
|
||||
|
||||
const jsCode = content.replace(`module.exports = class`, `export default new class`);
|
||||
const jsCode = content.replace(`module.exports = class`, `export default new class`).replace(/{ *Plugin *}/, `{ Plugin, powercord }`);
|
||||
|
||||
writeFileSync(`${manifestPath}/goosemodModule.json`, JSON.stringify(manifest));
|
||||
writeFileSync(`${manifestPath}/index.js`, jsCode);
|
||||
|
|
Loading…
Reference in a new issue