- 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 class
Plugin.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Plugin.Builder
builder(String name)
Creates a new plugin builder with the specified name.CommandProvider
getCommandProvider()
Gets the command provider for this plugin.reactor.core.publisher.Mono<Properties>
getGitProperties()
Gets the Git properties for this plugin.Set<Class<? extends GuildConfigDao<?>>>
getGuildConfigExtensions()
Gets the classes of database extensions useful to retrieve configuration for a guild.String
getName()
Gets the name of the plugin.reactor.core.publisher.Mono<Void>
onReady()
Gets a Mono that should be subscribed to when the bot is ready.
-
-
-
Method Detail
-
onReady
public reactor.core.publisher.Mono<Void> onReady()
Gets a Mono that should be subscribed to when the bot is ready.- Returns:
- a Mono
-
getName
public String getName()
Gets the name of the plugin.- Returns:
- the name
-
getGuildConfigExtensions
public Set<Class<? extends GuildConfigDao<?>>> getGuildConfigExtensions()
Gets the classes of database extensions useful to retrieve configuration for a guild.- Returns:
- a Set containing the classes of the guild configuration extensions
-
getCommandProvider
public CommandProvider getCommandProvider()
Gets the command provider for this plugin.- Returns:
- the command provider
-
getGitProperties
public reactor.core.publisher.Mono<Properties> 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
public static Plugin.Builder builder(String name)
Creates a new plugin builder with the specified name.- Parameters:
name
- the name of the plugin to build- Returns:
- a new Builder
-
-