-
Notifications
You must be signed in to change notification settings - Fork 0
1. General Plugin Structure
A simple Plugin usually consists of 2 files, index.js
and manifest.json
.
The Structure of your plugin should look like this for it to work, additional files and folders can be created but this is the bare minimum to get it to work
🗀 example-plugin
|_ manifest.json
|_ index.js
A file called manifest.json
is required in every Plugin and provides Replugged with information about your plugin, an example manifest.json file with all available fields would look like this
{
"name": "Example Name",
"version": "1.0.0",
"description": "My Plugin does this",
"author": "DiscordName#0001",
"license": "MIT",
"nsfw": false,
"permissions": "ext_api"
}
The name
, version
, description
, author
and license
Attributes are Required for your plugin to work.
The version
attribute can be set to 0.xxx or xxx-beta to show up as "Beta".
The nsfw
attribute has to be set to true if your Plugin uses Content considered Not Safe for Work, "permissions": "exp_api"
has to be included an if you use an API not provided by replugged.dev
The index.js
file is the heart of your Plugin, as this is the only file Replugged tries to run, it should unite every file you need for your Plugin.
This is the Base required for your Plugin to work.
const { Plugin } = require("powercord/entities");
module.exports = class PluginName extends Plugin {
startPlugin() {
// Initializing Here
}
pluginWillUnload() {
// Unloading Here
}
}
with const { Plugin } = require("powercord/entities");
we grab Replugged's Plugin class and use it in the Line Below to tell Replugged that this is a Plugin. PluginName
should be changed by you to match your Plugin.
The startPlugin()
method is called as soon as the Plugin starts and should be Used to Initialize Injections, commands or Settings (More to Injections, commands and Settings Later)
The pluginWillUnload()
method is called when the Plugin unloads and should be used to do some cleanup like Uninjecting and unregistering Commands/Settings.
Additional methods will be covered in a different section