What are plugins?
GCommands Next has started to support plugins. A plugin is an addition to GCommands that will make your job easier. Users can create custom plugins for inhibitors, events and such. GCommands has a couple of official plugins, which can be found hereopen in new window.
You always install the plugin as follows:
npm install gcommands-plugin-{name}
npm install @gcommands/plugin-{name} # for official plugins
yarn add gcommands-plugin-{name}
yarn add @gcommands/plugin-{name} # for official plugins
pnpm add gcommands-plugin-{name}
pnpm add @gcommands/plugin-{name} # for official plugins
In our case we use npm i @gcommands/plugin-moreevents
.
Once installed, all you have to do is make sure you have the following in the main file:
const { Plugins } = require('gcommands');
Plugins.search(__dirname);
2
3
Sometimes, as with the moreevents plugin, the plugin needs to be imported to modify the typings for discord.js events so that you can access the events more easily.
require('@gcommands/plugin-moreevents');
That's it! Now we can use other events added by moreevents. For official plugins, you will always find implementation instructions in the README.md and we hope that this will be the case for community plugins as well.
GCommands Plugin Language
For the @gcommands/plugin-language
plugin you can stay here for a while, because it has much more integration than it seems. With this plugin you are able to customize basic responses which you can find hereopen in new window.
You just need to add the following to your lang file:
{
"langname": {
"NOT_FOUND": "Invalid command",
"ERROR": "Command is broken :((",
"COOLDOWN": "Please wait {duration}",
"ARGUMENT_REQUIRED": "Please provide argument {name} with type {type}",
"ARGUMENT_TIME": "Time, please re-run command"
}
}
2
3
4
5
6
7
8
9
You can check full readme hereopen in new window