Basic Plugin
A basic guide to create your first disclosure plugin.
Step 1
We need a separate file for your own plugin, let's make one! say, MyPlugin.js
this should come under the directory name plugins
.
Now we import the plugin class to model our plugin from #disclosure/Plugin
Step 2
We create our custom plugin class extended from the Plugin class and then set it as the default export.
Step 3
We pass the plugin's metadata into this class so disclosure can destructure it and recognize it as a valid plugin
Step 4
All ready! Now we can use various functions available to this class, for example, the onLoad
event for slash commands.
That's it! start your bot application to try it out.
Resulting Code
Last updated