-
public interface Bot
Represents the bot itself.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandKernel
commandKernel()
Gets the command kernel of this bot.BotConfig
config()
Gets the config of the bot.reactor.core.publisher.Flux<GuildConfigurator<?>>
configureGuild(discord4j.rest.util.Snowflake guildId)
Retrieves all registered configurators for the given guild referenced by its ID.Database
database()
Gets the database of the bot.reactor.core.publisher.Mono<String>
emoji(String emojiName)
Gets the String representation of an emoji installed on one of the emoji servers.discord4j.core.GatewayDiscordClient
gateway()
Gets the gateway client of the bot.reactor.core.publisher.Mono<Void>
log(String message)
Sends a message into the debug log channel.reactor.core.publisher.Mono<discord4j.core.object.entity.User>
owner()
Gets the bot owner.Set<Plugin>
plugins()
Gets a Set containing all successfully loaded plugins.void
registerGuildConfigExtension(Class<? extends GuildConfigDao<?>> extension)
Registers a guild configuration extension to this database.discord4j.core.DiscordClient
rest()
Gets the REST client of the bot.void
start()
Starts the bot.
-
-
-
Method Detail
-
config
BotConfig config()
Gets the config of the bot.- Returns:
- the config
-
database
Database database()
Gets the database of the bot.- Returns:
- the database
-
commandKernel
CommandKernel commandKernel()
Gets the command kernel of this bot.- Returns:
- the command kernel
-
rest
discord4j.core.DiscordClient rest()
Gets the REST client of the bot.- Returns:
- the Discord client
-
gateway
discord4j.core.GatewayDiscordClient gateway()
Gets the gateway client of the bot.- Returns:
- the gateway client
-
plugins
Set<Plugin> plugins()
Gets a Set containing all successfully loaded plugins.- Returns:
- a Set of Plugin
-
owner
reactor.core.publisher.Mono<discord4j.core.object.entity.User> owner()
Gets the bot owner.- Returns:
- a Mono emitting the bot owner
-
log
reactor.core.publisher.Mono<Void> log(String message)
Sends a message into the debug log channel.- Parameters:
message
- the message to send- Returns:
- a Mono completing when the log message is sent
-
emoji
reactor.core.publisher.Mono<String> emoji(String emojiName)
Gets the String representation of an emoji installed on one of the emoji servers. If the emoji is not found, the returned value is the given name wrapped in colons.- Parameters:
emojiName
- the name of the emoji to look for- Returns:
- a Mono emitting the emoji code corresponding to the given name
-
configureGuild
reactor.core.publisher.Flux<GuildConfigurator<?>> configureGuild(discord4j.rest.util.Snowflake guildId)
Retrieves all registered configurators for the given guild referenced by its ID. Empty configuration data will be inserted in database for this specific guild if it doesn't exist yet.- Parameters:
guildId
- the guild ID- Returns:
- a Flux emitting all configurators for the guild
-
registerGuildConfigExtension
void registerGuildConfigExtension(Class<? extends GuildConfigDao<?>> extension)
Registers a guild configuration extension to this database. This allows to retrieve all configuration data via theconfigureGuild(Snowflake)
method.- Parameters:
extension
- the extension class to register
-
start
void start()
Starts the bot. This method blocks until the bot disconnects.
-
-