Skip to main content
This reference documents all methods available in the Nicotine+ plugin API through the BasePlugin class.

Events vs Notifications

There are two types of hooks available to plugins:

Events

Can modify data before Nicotine+ processes it. Time-critical - must execute quickly to avoid freezing the UI. Return modified arguments or return codes to control flow.

Notifications

Cannot modify data. Receive information about what happened. Can take as long as needed without blocking the UI. Preferred for most use cases.
Events are time-critical. Every millisecond spent in event handlers delays the UI. Only use events when you need to modify or block data - prefer notifications for everything else.

Return Codes

Event handlers can return special codes to control how Nicotine+ processes the event:

Example Usage

Chat Events

Incoming Chat

method
Use case: Filter spam, modify message display, implement custom formatting
method
Use case: Log messages, trigger actions based on chat content
method
Use case: Filter private messages, auto-respond to queries
method

Outgoing Chat

method
Use case: Add signatures, replace emoticons, implement shortcuts
method
method
method

Room Events

method
method
method
method
method

Private Room Events

method
method
method
method
method
method
method
method

Search Events

method
Use case: Track popular searches, identify potential leechers
method
method
method
method
method
method

Transfer Events

method
method
method
method
method

Server & User Events

method
method
method
method
method

ResponseThrottle Helper

The ResponseThrottle class helps avoid chat flooding when responding to user requests:
The Soulseek server can temporarily ban you from chat rooms if you send messages too quickly. Always use ResponseThrottle when building auto-responder plugins.

Next Steps

Plugin Examples

See real-world implementations using these APIs