Interface Bot
-
public interface Bot
Represents the bot itself.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<discord4j.core.object.entity.Channel>
getAttachmentsChannel()
Gets the channel where the bot can send attachments for its embeds.String
getAuthLink()
Gets the authorization link to add the bot to a server.CommandKernel
getCommandKernel()
Gets the command kernel of this bot.Database
getDatabase()
Gets the database of the bot.reactor.core.publisher.Mono<discord4j.core.object.entity.Channel>
getDebugLogChannel()
Gets the channel where the bot sends messages for debugging purposes.String
getDefaultPrefix()
Gets the default prefix.reactor.core.publisher.Flux<discord4j.core.DiscordClient>
getDiscordClients()
Gets the discord client.reactor.core.publisher.Mono<String>
getEmoji(String emojiName)
Gets the String representation of an emoji installed on one of the emoji servers.Map<Plugin,Map<String,GuildSettingsEntry<?,?>>>
getGuildSettingsEntries()
Gets the guild settings entries loaded from plugins.String
getReleaseVersion()
Gets the release version of the bot.int
getReplyMenuTimeout()
Gets the maximum time in seconds that the bot should wait for a reply when a reply menu is open.String
getSupportServerInviteLink()
Gets the discord.gg link to the support server.String
getToken()
Get the bot token.reactor.core.publisher.Mono<discord4j.core.object.entity.Message>
log(String message)
Sends a message into the debug log channel.reactor.core.publisher.Mono<discord4j.core.object.entity.Message>
log(java.util.function.Consumer<discord4j.core.spec.MessageCreateSpec> spec)
Sends a message into the debug log channel.reactor.core.publisher.Mono<discord4j.core.object.entity.Message>
logStackTrace(Context ctx, Throwable t)
Prints a Throwable's stack trace in the log channel.
-
-
-
Method Detail
-
getReleaseVersion
String getReleaseVersion()
Gets the release version of the bot.- Returns:
- the release verion
-
getSupportServerInviteLink
String getSupportServerInviteLink()
Gets the discord.gg link to the support server.- Returns:
- the link to the support server
-
getAuthLink
String getAuthLink()
Gets the authorization link to add the bot to a server.- Returns:
- the authorization link
-
getToken
String getToken()
Get the bot token.- Returns:
- the token
-
getDefaultPrefix
String getDefaultPrefix()
Gets the default prefix.- Returns:
- the default prefix
-
getDiscordClients
reactor.core.publisher.Flux<discord4j.core.DiscordClient> getDiscordClients()
Gets the discord client.- Returns:
- the discord client
-
getDatabase
Database getDatabase()
Gets the database of the bot.- Returns:
- the database
-
getDebugLogChannel
reactor.core.publisher.Mono<discord4j.core.object.entity.Channel> getDebugLogChannel()
Gets the channel where the bot sends messages for debugging purposes.- Returns:
- a Mono emitting the debug log channel
-
getAttachmentsChannel
reactor.core.publisher.Mono<discord4j.core.object.entity.Channel> getAttachmentsChannel()
Gets the channel where the bot can send attachments for its embeds.- Returns:
- a Mono emitting the attachments channel
-
log
reactor.core.publisher.Mono<discord4j.core.object.entity.Message> log(String message)
Sends a message into the debug log channel.- Parameters:
message
- the message to send- Returns:
- a Mono emitting the message sent
-
log
reactor.core.publisher.Mono<discord4j.core.object.entity.Message> log(java.util.function.Consumer<discord4j.core.spec.MessageCreateSpec> spec)
Sends a message into the debug log channel.- Parameters:
spec
- the spec of the message to send- Returns:
- a Mono emitting the message sent
-
logStackTrace
reactor.core.publisher.Mono<discord4j.core.object.entity.Message> logStackTrace(Context ctx, Throwable t)
Prints a Throwable's stack trace in the log channel. The message may be splitted in case it doesn't fit in 2000 characters.- Parameters:
ctx
- the context in which the error occuredt
- the throwable to print the strack trace of- Returns:
- a Flux emitting all messages sent to logs (if splitted due to character limit), or only one message otherwise.
-
getEmoji
reactor.core.publisher.Mono<String> getEmoji(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
-
getReplyMenuTimeout
int getReplyMenuTimeout()
Gets the maximum time in seconds that the bot should wait for a reply when a reply menu is open.- Returns:
- the value as int (in seconds)
-
getGuildSettingsEntries
Map<Plugin,Map<String,GuildSettingsEntry<?,?>>> getGuildSettingsEntries()
Gets the guild settings entries loaded from plugins. UnlikeContext.getGuildSettings()
, this does not get the values for a specific guild, it gives functions to retrieve the values from any guild.- Returns:
- an unmodifiable Map containing the guild settings keys and their associated values.
-
getCommandKernel
CommandKernel getCommandKernel()
Gets the command kernel of this bot.- Returns:
- the command kernel
-
-