Class BotConfig.Builder
java.lang.Object
com.github.alex1304.ultimategdbot.api.BotConfig.Builder
- Enclosing class:
- BotConfig
public static class BotConfig.Builder extends Object
-
Method Summary
Modifier and Type Method Description BotConfigbuild()Builds aBotConfigwith the configured values.BotConfig.BuildersetCommandPrefix(String commandPrefix)Sets the prefix to use for commands.BotConfig.BuildersetDebugLogChannelId(discord4j.rest.util.Snowflake debugLogChannelId)Sets the channel ID where the bot will send debug log messages.BotConfig.BuildersetEmojiGuildIds(Set<discord4j.rest.util.Snowflake> emojiGuildIds)Sets the guild IDs where the bot will look for emojis.BotConfig.BuildersetFlagPrefix(String flagPrefix)Sets the prefix to use for command flags.BotConfig.BuildersetInteractiveMenuTimeout(Duration interactiveMenuTimeout)Sets the timeout after which interactive menus will automatically close.BotConfig.BuildersetMessageCacheMaxSize(int messageCacheMaxSize)Sets the maximum size of the message cache.BotConfig.BuildersetPaginationControls(PaginationControls paginationControls)Sets the pagination controls to use for interative menus.BotConfig.BuildersetRestBufferSize(int restBufferSize)Sets the buffer size for Discord REST requests.BotConfig.BuildersetRestTimeout(Duration restTimeout)Sets the timeout to apply on each Discord REST request.BotConfig.BuildersetStatus(discord4j.discordjson.json.gateway.StatusUpdate status)Sets the initial bot's status.
-
Method Details
-
setCommandPrefix
Sets the prefix to use for commands.- Parameters:
commandPrefix- the command prefix, or null to useBotConfig.DEFAULT_COMMAND_PREFIX- Returns:
- this builder
-
setFlagPrefix
Sets the prefix to use for command flags.- Parameters:
flagPrefix- the flag prefix, or null to useBotConfig.DEFAULT_FLAG_PREFIX- Returns:
- this builder
-
setDebugLogChannelId
public BotConfig.Builder setDebugLogChannelId(@Nullable discord4j.rest.util.Snowflake debugLogChannelId)Sets the channel ID where the bot will send debug log messages.- Parameters:
debugLogChannelId- the debug log channel ID, may be null- Returns:
- this builder
-
setEmojiGuildIds
Sets the guild IDs where the bot will look for emojis.- Parameters:
emojiGuildIds- the emoji guild IDs- Returns:
- this builder
- Throws:
NullPointerException- if emojiGuildIds is null
-
setStatus
public BotConfig.Builder setStatus(@Nullable discord4j.discordjson.json.gateway.StatusUpdate status)Sets the initial bot's status.- Parameters:
status- the status, or null to useBotConfig.DEFAULT_STATUS- Returns:
- this builder
-
setPaginationControls
Sets the pagination controls to use for interative menus.- Parameters:
paginationControls- the pagination controls, or null to usePaginationControls.getDefault()- Returns:
- this builder
-
setInteractiveMenuTimeout
Sets the timeout after which interactive menus will automatically close.- Parameters:
interactiveMenuTimeout- the interactive menu timeout, or null to useBotConfig.DEFAULT_INTERACTIVE_MENU_TIMEOUT- Returns:
- this builder
-
setMessageCacheMaxSize
Sets the maximum size of the message cache.- Parameters:
messageCacheMaxSize- the message cache max size- Returns:
- this builder
- Throws:
IllegalArgumentException- if messageCacheMaxSize is negative
-
setRestTimeout
Sets the timeout to apply on each Discord REST request.- Parameters:
restTimeout- the REST timeout, or null to useBotConfig.DEFAULT_REST_TIMEOUT- Returns:
- this builder
-
setRestBufferSize
Sets the buffer size for Discord REST requests.- Parameters:
restBufferSize- the REST buffer size- Returns:
- this builder
- Throws:
IllegalArgumentException- if restBufferSize is zero or negative
-
build
Builds aBotConfigwith the configured values.- Returns:
- a new
BotConfig
-