diff --git a/moduleWrappers/powercord/entities.js b/moduleWrappers/powercord/entities.js index 13a7b78..140e91a 100644 --- a/moduleWrappers/powercord/entities.js +++ b/moduleWrappers/powercord/entities.js @@ -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 }) => { diff --git a/src/preprocessors/pcPlugin.js b/src/preprocessors/pcPlugin.js index 691802d..823cc38 100644 --- a/src/preprocessors/pcPlugin.js +++ b/src/preprocessors/pcPlugin.js @@ -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);