Plugin
Plugin
#
PluginManager
#
PluginManager(client: Client)
A class that allows you to load and unload plugins. You should not construct
this class yourself. It will be provided to you as the clients.plugins
property when you construct a Client
object.
load
#
Load a plugin from the module path.
PARAMETER | DESCRIPTION |
---|---|
path |
The module path for the plugin.
TYPE:
|
refresh |
Whether or not to reload the plugin and the plugin's module.
TYPE:
|
strict |
If false, the function will not error when module file does not have a plugin variable.
TYPE:
|
load_folder
#
Loads plugins from a folder.
import crescent
import hikari
bot = hikari.GatewayBot(token=...)
client = crescent.Client(bot)
client.plugins.load("project.plugin_folder")
If a file is attempted to be loaded that does not have a plugin variable,
a ValueError
will be raised. Files who's names start with an underscore
will not be loaded.
PARAMETER | DESCRIPTION |
---|---|
path |
The path to the folder that contains the plugins.
TYPE:
|
refresh |
Whether or not to reload the plugin and the plugin's module.
TYPE:
|
strict |
If false, the function will not error when a file does not have a plugin variable.
TYPE:
|
Returns: A list of plugins that were loaded.