Events¶
Plugged works with a wide variety of events to emit information throughout the system. This site lists all events that are emitted and what they do.
For further information about the events and how to use them you should consider hitting up the cookbook.
Events¶
ACK¶
Emitted when the server acknowledged the connection request.
Parameters:
undefined
ADVANCE¶
BAN_IP¶
Emitted when you receive an IP Ban from plug.
Parameters:
undefined
CHAT¶
CHAT_DELETE¶
Emitted when a staff member deletes a chat message.
Parameters:
chat: ChatDelete deleted Chat object.
CHAT_RATE_LIMIT¶
Emitted when chat enters slow mode.
Parameters:
undefined
CONN_WARNING¶
Emitted when server is not exchanging any information with us for a longer period of time.
Parameters:
time: Number Time in seconds since the last message. This has an incrementation rate of 30 seconds per call. The client will close the connection after 6 emitted warnings, or 3 minutes of no connection.
DJ_LIST_CYCLE¶
EARN¶
Emitted when you earn XP. This also includes your Plug points as well as your current level.
Parameters:
Level: Earn
FLOOD_API¶
Emitted when you send too many requests to the API at a time.
Note
Plugged takes care of the effect of rate limiters in plug so that you don’t have to care about this happening.
Parameters:
undefined
FLOOD_CHAT¶
Emitted when you send too many chat messages at once.
Plugged takes care of this as well as it does for FLOOD_API. In a default environment, this event will never fire.
Parameters:
undefined
FRIEND_ACCEPT¶
Emitted when someone accepted your friend request.
Parameters:
user: String username.
FRIEND_REQUEST¶
Emitted when you receive a friend request.
Parameters:
user: String username.
GIFTED¶
Emitted when someone sends a gift to another user.
Parameters:
sender: String sender’s name. recipient: String recipient’s name.
GRAB¶
Emitted when someone saves the current media.
Parameters:
grab: Number User’s ID.
GUEST_JOIN¶
Emitted when a guest joins the room.
Parameters:
undefined
GUEST_LEAVE¶
Emitted when a guest leaves the room.
Parameters:
undefined
LEVEL_UP¶
Emitted when you gained enough XP to level up.
Parameters:
level: Number your new level.
MAINTENANCE_MODE¶
Emitted when plug enters maintenance mode.
Parameters:
undefined
MAINTENANCE_MODE_ALERT¶
Emitted when plug is about to enter maintenance mode.
Parameters:
undefined
MOD_WAITLIST_BAN¶
MOD_MOVE_DJ¶
Emitted when a moderator moves a user in othe waitlist to another position.
Parameters:
modmove: ModMove
MOD_MUTE¶
MOD_STAFF¶
Emitted when a user gets promoted
The promotion argument is always an array since it can happen that the staff level of two users is changed, namely when the host is giving his position to another user.
Parameters:
promotions: [Promotion]
NOTIFY¶
Emitted when you receive a notification from plug for example when your level raises.
Parameters:
notification: Notification
PLAYLIST_CYCLE¶
Emitted when you finish playing a song.
Parameters:
Cycle: Number playlist ID.
PLUG_UPDATE¶
Emitted when plug was updated. This enforces a refresh on the web app.
Parameters:
undefined
ROOM_DESCRIPTION_UPDATE¶
ROOM_MIN_CHAT_LEVEL_UPDATE¶
ROOM_NAME_UPDATE¶
ROOM_WELCOME_UPDATE¶
SKIP¶
Emitted when a user skips their play.
Parameters:
userid: Number User’s ID.
SOCK_CLOSED¶
Emitted when socket is closed
Parameters:
undefined
SOCK_ERROR¶
Emitted on failure of etablishing a websocket connection to plug.
Parameters:
err: String containing the error message.
SOCK_OPEN¶
Emitted on successfully etablishing a websocket connection to plug.
Parameters:
undefined
USER_UPDATE¶
WAITLIST_UPDATE¶
Emitted when a user joins or leaves the waitlist, or right after the advance event was fired.
Parameters:
waitlist: [Number] waitlist with user IDs