Class BotConfig.Builder
- java.lang.Object
-
- com.github.alex1304.ultimategdbot.api.BotConfig.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BotConfig
build()
Builds aBotConfig
with the configured values.BotConfig.Builder
setCommandPrefix(String commandPrefix)
Sets the prefix to use for commands.BotConfig.Builder
setDebugLogChannelId(discord4j.rest.util.Snowflake debugLogChannelId)
Sets the channel ID where the bot will send debug log messages.BotConfig.Builder
setEmojiGuildIds(Set<discord4j.rest.util.Snowflake> emojiGuildIds)
Sets the guild IDs where the bot will look for emojis.BotConfig.Builder
setFlagPrefix(String flagPrefix)
Sets the prefix to use for command flags.BotConfig.Builder
setInteractiveMenuTimeout(Duration interactiveMenuTimeout)
Sets the timeout after which interactive menus will automatically close.BotConfig.Builder
setMessageCacheMaxSize(int messageCacheMaxSize)
Sets the maximum size of the message cache.BotConfig.Builder
setPaginationControls(PaginationControls paginationControls)
Sets the pagination controls to use for interative menus.BotConfig.Builder
setRestBufferSize(int restBufferSize)
Sets the buffer size for Discord REST requests.BotConfig.Builder
setRestTimeout(Duration restTimeout)
Sets the timeout to apply on each Discord REST request.BotConfig.Builder
setStatus(discord4j.discordjson.json.gateway.StatusUpdate status)
Sets the initial bot's status.
-
-
-
Method Detail
-
setCommandPrefix
public BotConfig.Builder setCommandPrefix(@Nullable String commandPrefix)
Sets the prefix to use for commands.- Parameters:
commandPrefix
- the command prefix, or null to useBotConfig.DEFAULT_COMMAND_PREFIX
- Returns:
- this builder
-
setFlagPrefix
public BotConfig.Builder setFlagPrefix(@Nullable String flagPrefix)
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
public BotConfig.Builder setEmojiGuildIds(Set<discord4j.rest.util.Snowflake> emojiGuildIds)
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
public BotConfig.Builder setPaginationControls(@Nullable PaginationControls paginationControls)
Sets the pagination controls to use for interative menus.- Parameters:
paginationControls
- the pagination controls, or null to usePaginationControls.getDefault()
- Returns:
- this builder
-
setInteractiveMenuTimeout
public BotConfig.Builder setInteractiveMenuTimeout(@Nullable Duration interactiveMenuTimeout)
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
public BotConfig.Builder setMessageCacheMaxSize(int messageCacheMaxSize)
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
public BotConfig.Builder setRestTimeout(@Nullable Duration restTimeout)
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
public BotConfig.Builder setRestBufferSize(int restBufferSize)
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
-
-