Skip to main content
Nicotine+ features a powerful plugin system that allows you to extend functionality through Python code. Plugins can respond to events, modify chat messages, add custom commands, and integrate with external services.

Plugin Structure

Every Nicotine+ plugin consists of two required files in a dedicated folder:
1

Create Plugin Folder

Create a new folder for your plugin. The folder name becomes the plugin’s internal name.
2

Create PLUGININFO File

Add a PLUGININFO file with metadata about your plugin:
The Name field is the human-readable name shown in the UI, while the folder name is the technical identifier.
3

Create __init__.py File

Create an __init__.py file with your plugin class:
4

Install and Enable

After creating your plugin files:
  1. Close and reopen the Preferences dialog if it’s open
  2. Go to Preferences → Plugins
  3. Find your plugin in the list and enable it
There’s no need to restart Nicotine+ when installing or updating plugins.

Plugin Lifecycle

Understanding the plugin lifecycle is crucial for proper initialization and cleanup:

Initialization Sequence

Shutdown Sequence

Available Attributes

Your plugin class has access to several important attributes:
string
Technical plugin name based on the folder name. Read-only.
string
Friendly plugin name from PLUGININFO. Read-only.
string
Folder path where plugin files are stored. Read-only.
PluginHandler
Reference to the PluginHandler instance. Read-only.
Config
Reference to global Config handler. Read-only.
Core
Reference to Core instance for accessing users, rooms, searches, etc. Read-only.
dict
Dictionary of plugin settings. Define in __init__(), access in init() and later.
dict
Metadata describing how settings should be displayed in the UI.
dict
Dictionary of commands provided by this plugin.

Plugin Settings

Plugins can define user-configurable settings that appear in the Preferences dialog:

Supported Setting Types

  • bool - Checkbox
  • integer - Integer spinner with optional min/max
  • float - Float spinner with optional min/max/stepsize
  • string - Text input
  • list string - List of strings
  • radio - Radio buttons with options tuple
  • dropdown - Dropdown menu with options tuple

Utility Methods

The BasePlugin class provides several convenience methods:

Logging

Sending Messages

Displaying Local Messages

Message types: action, remote, local, hilite, command

Next Steps

API Reference

Explore all available events, notifications, and methods

Plugin Examples

Learn from real-world plugin implementations
Performance Note: Event handlers (methods ending in _event) are time-critical and can freeze the UI if they take too long. Use notifications (_notification) whenever possible, as they don’t block the application.