Class Plugin
java.lang.Object
com.github.alex1304.ultimategdbot.api.Plugin
public class Plugin extends Object
Represents a plugin. A plugin has a name and provides commands.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlugin.Builder -
Method Summary
Modifier and Type Method Description static Plugin.Builderbuilder(String name)Creates a new plugin builder with the specified name.CommandProvidergetCommandProvider()Gets the command provider for this plugin.Set<String>getDatabaseMappingResources()Gets a set of resource names that corresponds to database mapping files.reactor.core.publisher.Mono<Properties>getGitProperties()Gets the Git properties for this plugin.Map<String,GuildSettingsEntry<?,?>>getGuildConfigurationEntries()Gets a map of configuration entries for guilds.StringgetName()Gets the name of the plugin.reactor.core.publisher.Mono<Void>runOnReady()
-
Method Details
-
runOnReady
-
getName
Gets the name of the plugin.- Returns:
- the name
-
getDatabaseMappingResources
Gets a set of resource names that corresponds to database mapping files. Mapping files usually end with *.hbm.xml and should be located at the root of thesrc/main/resourcesdirectory of the plugin- Returns:
- a set containing the name of all mapping files used in the plugin.
-
getGuildConfigurationEntries
Gets a map of configuration entries for guilds. Anything added here will be listed when using the setup command.- Returns:
- the guild configuration entries
-
getCommandProvider
Gets the command provider for this plugin.- Returns:
- the command provider
-
getGitProperties
Gets the Git properties for this plugin. By default, it will look for a file named[plugin name].git.properties(where plugin name is the name of the plugin as returned bygetName()but all lowercase and with spaces replaced with underscores), in thegitprops/subdirectory of the resource classpath. If none is found, the returned Mono will complete empty.- Returns:
- a Mono emitting the git properties if found
-
builder
Creates a new plugin builder with the specified name.- Parameters:
name- the name of the plugin to build- Returns:
- a new Builder
-