Use this file to discover all available pages before exploring further.
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.
class Plugin(BasePlugin): def __init__(self, *args, **kwargs): """Plugin class is initializing. Settings are NOT available yet. Use this to define settings structure and initialize instance variables. """ super().__init__(*args, **kwargs) # Define plugin settings self.settings = { "enabled": True, "message": "Hello World" } def init(self): """Called after __init__() when settings have loaded. Settings ARE available. Use this for initialization logic that depends on settings values. """ if self.settings["enabled"]: self.log("Plugin is enabled!") def loaded_notification(self): """Plugin has finished loading and commands are registered. Use this if you need to perform actions after the plugin is fully loaded and ready. """ pass
def disable(self): """Plugin has started unloading. Clean up resources, cancel timers, close connections. """ self.log("Plugin is shutting down")def unloaded_notification(self): """Plugin has finished unloading. Final cleanup tasks. """ passdef shutdown_notification(self): """Application is shutting down. Perform any necessary cleanup before Nicotine+ exits. """ pass
# Send to chat room (must be joined)self.send_public("room_name", "Hello everyone!")# Send private messageself.send_private("username", "Hello!", show_ui=True, switch_page=True)# Send to command source (works in commands)self.send_message("This goes to wherever the command was run")
# Display message in room without sending to serverself.echo_public("room_name", "Local message", message_type="local")# Display in private chat without sendingself.echo_private("username", "Local message", message_type="local")# Display in command sourceself.echo_message("Status info", message_type="local")# Output command results (recommended for commands)self.output("Command executed successfully")
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.