Package com.mcawful.social
Class SocialPlatformRegistry
java.lang.Object
com.mcawful.social.SocialPlatformRegistry
- All Implemented Interfaces:
Listener
The social media platforms known to the bot
Exposed to scripts as $.socialPlatforms. Also answers the panel's requests to link and unlink an account, sent with
socket.wsEvent(id, 'SocialPlatforms.java', null, ['link', platformId, account, secret, service], callback, true) or
['unlink', platformId]. Only the panel's config users may send them (see PanelUserHandler).
- Author:
- mcawful
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe script name the panel sends link and unlink requests to -
Method Summary
Modifier and TypeMethodDescriptionReturns a platform by idReturns every platformstatic SocialPlatformRegistryinstance()Returns the instance, creating it and its platforms on first usevoidHandles the panel's link and unlink requestsvoidshutdown()Releases the resources of every platform
-
Field Details
-
PANEL_SCRIPT
The script name the panel sends link and unlink requests to- See Also:
-
-
Method Details
-
instance
Returns the instance, creating it and its platforms on first use- Returns:
- the instance
-
get
Returns a platform by id- Parameters:
id- the platform id, such asbluesky- Returns:
- the platform;
nullif there is none with that id
-
getPlatforms
Returns every platform- Returns:
- the platforms
-
onWebPanelSocketUpdateEvent
Handles the panel's link and unlink requests- Parameters:
event- the event
-
shutdown
public void shutdown()Releases the resources of every platform
-