Package io.manebot.platform
Interface Platform
-
- All Known Implementing Classes:
Platform
public interface PlatformPlatforms are the structure of the bot that represent individual chatting platforms, such as Discord, Skype, and so on.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPlatform.Builder
-
Method Summary
Modifier and Type Method Description default PlatformConnectiongetConnection()Gets the current platform connection instance for this platform.default UserGroupgetDefaultGroup()Gets the default group assignment for users registered on this platform.java.lang.StringgetId()Gets the platform's internal unique ID.default PlugingetPlugin()Gets the current plugin instance for this platform.PlatformRegistrationgetRegistration()Gets the runtime registration associated with this platform.default UserAssociationgetUserAssocation(PlatformUser user)Gets a specific assocation for this platform.default UserAssociationgetUserAssocation(java.lang.String id)Gets a specific assocation for this platform.java.util.Collection<UserAssociation>getUserAssociations()Gets a list of user associations for this platform.default java.util.Collection<UserAssociation>getUserAssociations(User user)Gets a set of user associations for the specified user.default booleanisConnected()Finds if the platform is currently connected.booleanisRegistrationAllowed()Finds if registration is allowed.voidsetDefaultGroup(UserGroup defaultGroup)Sets the default group assignment for users registered on this platform.voidsetRegistrationAllowed(boolean allowed)Sets if registration is allowed on this platform.
-
-
-
Method Detail
-
getRegistration
PlatformRegistration getRegistration()
Gets the runtime registration associated with this platform.- Returns:
- Platform runtime registration.
-
getDefaultGroup
default UserGroup getDefaultGroup()
Gets the default group assignment for users registered on this platform.- Returns:
- Platform default user group, or null if no default is assigned.
-
setDefaultGroup
void setDefaultGroup(UserGroup defaultGroup)
Sets the default group assignment for users registered on this platform.- Parameters:
defaultGroup- default user group for newly registered users.
-
getId
java.lang.String getId()
Gets the platform's internal unique ID.- Returns:
- platform ID.
-
isRegistrationAllowed
boolean isRegistrationAllowed()
Finds if registration is allowed.- Returns:
- true if registration is allowed, false otherwise.
-
setRegistrationAllowed
void setRegistrationAllowed(boolean allowed)
Sets if registration is allowed on this platform.- Parameters:
allowed- true if registration is allowed, false otherwise.
-
isConnected
default boolean isConnected()
Finds if the platform is currently connected.- Returns:
- true if the platform is connected, false otherwise.
-
getUserAssocation
default UserAssociation getUserAssocation(java.lang.String id)
Gets a specific assocation for this platform.- Parameters:
id- Platform-specific user ID to search for.- Returns:
- user association if found on this platform, null otherwise.
-
getUserAssocation
default UserAssociation getUserAssocation(PlatformUser user)
Gets a specific assocation for this platform.- Parameters:
user- Platform-specific user to search for.- Returns:
- user association if found on this platform, null otherwise.
-
getUserAssociations
default java.util.Collection<UserAssociation> getUserAssociations(User user)
Gets a set of user associations for the specified user.- Parameters:
user- User to search for.- Returns:
- collection of user associations for the specified uesr.
-
getUserAssociations
java.util.Collection<UserAssociation> getUserAssociations()
Gets a list of user associations for this platform.- Returns:
- collection of user associations.
-
getConnection
default PlatformConnection getConnection()
Gets the current platform connection instance for this platform.- Returns:
- PlatformConnection instance of this platform.
-
getPlugin
default Plugin getPlugin()
Gets the current plugin instance for this platform.- Returns:
- Plugin instance of this platform, or null if no plugin was associated with registering this Platform.
-
-