Overview
Plugins are stored in two locations:- System plugins: Built-in plugins located in
pynicotine/plugins/ - User plugins: Your custom plugins in
~/.local/share/nicotine/plugins/(or your configured data folder)
All plugins extend the
BasePlugin class and can hook into various events throughout the application lifecycle.Installing Plugins
1
Download the plugin
Plugins are typically distributed as
.zip files or folders containing Python code and a PLUGININFO file.2
Install via GUI
- Open Nicotine+ and go to Settings → Plugins
- Click the Install Plugin button
- Select the plugin
.zipfile - The plugin will be extracted to your user plugins folder
3
Enable the plugin
- Find the newly installed plugin in the plugins list
- Check the box next to the plugin name to enable it
- The plugin will load immediately
Manual Installation
You can also manually install plugins by extracting them to your user plugins folder:Plugin Structure
Every plugin requires at minimum:Plugin Capabilities
Event Hooks
Plugins can hook into numerous events. Here are the most commonly used:Chat Events
Search Events
Transfer Events
Connection Events
Return Codes
Event methods can return special codes to control message flow:returncode["break"](0) - Stop other plugins from processing, but let Nicotine+ handle itreturncode["zap"](1) - Stop other plugins and block Nicotine+ from processingreturncode["pass"](2) - Continue to next plugin (default if nothing returned)
Custom Commands
Plugins can register commands for chat rooms, private chats, and CLI:/command in chat:
Plugin Settings
Plugins can define configurable settings:Helper Methods
Sending Messages
Logging
Built-in Plugins
Nicotine+ includes several built-in plugins:- core_commands - Essential commands (always enabled)
- spamfilter - Filter spam messages based on length and patterns
- leech_detector - Detect users who download without sharing
- now_playing_sender - Share currently playing music (MPRIS)
- auto_buddy_rooms - Automatically join rooms of buddies
- auto_user_browse - Auto-browse users who browse you
Example: Spam Filter Plugin
Here’s a complete example of the built-in spam filter:Advanced Features
ResponseThrottle
Prevent flooding when responding to user requests:Accessing Core Components
Plugins have access to core Nicotine+ components:Lifecycle Methods
Plugins can implement these lifecycle methods:Uninstalling Plugins
To remove a plugin:1
Disable the plugin
Uncheck the plugin in Settings → Plugins to disable it.
2
Uninstall
Click the Uninstall button next to the plugin (user plugins only).
Built-in system plugins cannot be uninstalled, only disabled.
Next Steps
- Review built-in plugins in the source code at
pynicotine/plugins/ - Check the
examplarsplugin folder for additional examples - Read the BasePlugin API documentation