-
Notifications
You must be signed in to change notification settings - Fork 6
SkyChat Plugin Hooks Documentation
SkyChat plugins can interact with various events in the messaging application through hooks. These hooks allow plugins to respond to or modify the behavior of specific actions within the application. This document lists all available hooks for RoomPlugin
and GlobalPlugin
.
RoomPlugin
hooks are specific to room-related events, allowing the plugin to interact with activities within a particular chat room.
- Description: Executed before a message is broadcasted to the room.
-
Parameters:
-
message
: The message about to be broadcasted. -
connection
: The connection that sent the message.
-
-
Returns: Modified or original
Message
.
- Description: Executed before a connection joins a room.
-
Parameters:
-
connection
: The connection attempting to join the room.
-
- Returns: Void.
- Description: Executed when a connection successfully joins a room.
-
Parameters:
-
connection
: The connection that joined the room.
-
- Returns: Void.
- Description: Executed when a connection leaves a room.
-
Parameters:
-
connection
: The connection that left the room.
-
- Returns: Void.
GlobalPlugin
hooks are designed to handle application-wide events and are not specific to any particular room.
- Description: Executed when a new message is received in the application.
-
Parameters:
-
message
: The received message. -
connection
: The connection that sent the message.
-
- Returns: Modified or original message string.
- Description: Executed when a new connection is created.
-
Parameters:
-
connection
: The new connection.
-
- Returns: Void.
- Description: Executed when a connection successfully authenticates.
-
Parameters:
-
connection
: The authenticated connection.
-
- Returns: Void.
- Description: Executed when a connection is closed.
-
Parameters:
-
connection
: The connection that was closed.
-
- Returns: Void.
These hooks provide a powerful interface for RoomPlugin
and GlobalPlugin
to interact with various events within SkyChat. By utilizing these hooks, developers can create plugins that effectively respond to and influence the behavior of the application, enhancing the user experience in SkyChat.