Plugin System
Plugins extend the bot's functionality at runtime — no restart needed.
Bundled plugin: Speedtest
/speedtestTests your server's internet download and upload speed. Uses speedtest-cli.
/speedtestonly exists while the plugin is loaded and enabled. If the command does nothing, open/pluginsand enable it.
Managing plugins
/pluginsOpens the plugin manager menu where you can:
- List all loaded plugins
- Load a new plugin from the
plugins/folder - Unload a running plugin
- Enable/Disable individual plugins
- View info about each plugin (name, version, author, description)
Adding a plugin
- Place a
.pyfile in theplugins/folder on your server - Send
/pluginsto the bot - Click Load and select your plugin
Writing a custom plugin
A basic plugin structure:
python
from bot.core.plugin_manager import PluginBase, PluginInfo
class MyPlugin(PluginBase):
PLUGIN_INFO = PluginInfo(
name="my_plugin",
version="1.0.0",
author="Your Name",
description="Does something useful",
enabled=True,
handlers=[],
commands=["mycommand"], # registers /mycommand
dependencies=[],
)
async def on_load(self) -> bool:
return True
async def on_unload(self) -> bool:
return True
async def on_enable(self) -> bool:
return True
async def on_disable(self) -> bool:
return TruePlace it in plugins/my_plugin.py and load it via /plugins. Any name listed in commands is added to the bot's command list automatically.
plugins/speedtest_plugin.py in the repo is a complete working example — copy it as your starting point.