Class BotConfig
- java.lang.Object
-
- com.github.alex1304.ultimategdbot.api.BotConfig
-
public class BotConfig extends Object
Holds the bot's configuration.- See Also:
builder(String)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BotConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_COMMAND_PREFIX
static String
DEFAULT_FLAG_PREFIX
static Duration
DEFAULT_INTERACTIVE_MENU_TIMEOUT
static int
DEFAULT_MESSAGE_CACHE_MAX_SIZE
static int
DEFAULT_REST_BUFFER_SIZE
static Duration
DEFAULT_REST_TIMEOUT
static discord4j.discordjson.json.gateway.StatusUpdate
DEFAULT_STATUS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BotConfig.Builder
builder(String token)
Creates a new builder ofBotConfig
.String
getCommandPrefix()
Gets the prefix to use for commands.Optional<discord4j.rest.util.Snowflake>
getDebugLogChannelId()
Gets the channel ID where the bot will send debug log messages, if present.Set<discord4j.rest.util.Snowflake>
getEmojiGuildIds()
Gets the guild IDs where the bot will look for emojis.String
getFlagPrefix()
Gets the prefix to use for command flags.Duration
getInteractiveMenuTimeout()
Gets the timeout after which interactive menus will automatically close.int
getMessageCacheMaxSize()
Gets the maximum size of the message cache.PaginationControls
getPaginationControls()
Gets the pagination controls to use for interactive menus.int
getRestBufferSize()
Gets the buffer size for Discord REST requests.Duration
getRestTimeout()
Gets the timeout to apply on each Discord REST request.discord4j.discordjson.json.gateway.StatusUpdate
getStatus()
Gets the initial bot's status.String
getToken()
Gets the bot token.
-
-
-
Field Detail
-
DEFAULT_COMMAND_PREFIX
public static final String DEFAULT_COMMAND_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_FLAG_PREFIX
public static final String DEFAULT_FLAG_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_STATUS
public static final discord4j.discordjson.json.gateway.StatusUpdate DEFAULT_STATUS
-
DEFAULT_INTERACTIVE_MENU_TIMEOUT
public static final Duration DEFAULT_INTERACTIVE_MENU_TIMEOUT
-
DEFAULT_MESSAGE_CACHE_MAX_SIZE
public static final int DEFAULT_MESSAGE_CACHE_MAX_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_REST_TIMEOUT
public static final Duration DEFAULT_REST_TIMEOUT
-
DEFAULT_REST_BUFFER_SIZE
public static final int DEFAULT_REST_BUFFER_SIZE
-
-
Method Detail
-
getToken
public String getToken()
Gets the bot token.- Returns:
- the bot token
-
getCommandPrefix
public String getCommandPrefix()
Gets the prefix to use for commands.- Returns:
- the command prefix
-
getFlagPrefix
public String getFlagPrefix()
Gets the prefix to use for command flags.- Returns:
- the flag prefix
-
getDebugLogChannelId
public Optional<discord4j.rest.util.Snowflake> getDebugLogChannelId()
Gets the channel ID where the bot will send debug log messages, if present.- Returns:
- the debug log channel ID, if present
-
getEmojiGuildIds
public Set<discord4j.rest.util.Snowflake> getEmojiGuildIds()
Gets the guild IDs where the bot will look for emojis.- Returns:
- the emoji guild IDs
-
getStatus
public discord4j.discordjson.json.gateway.StatusUpdate getStatus()
Gets the initial bot's status.- Returns:
- the status
-
getPaginationControls
public PaginationControls getPaginationControls()
Gets the pagination controls to use for interactive menus.- Returns:
- the pagination controls
-
getInteractiveMenuTimeout
public Duration getInteractiveMenuTimeout()
Gets the timeout after which interactive menus will automatically close.- Returns:
- the interactive menu timeout
-
getMessageCacheMaxSize
public int getMessageCacheMaxSize()
Gets the maximum size of the message cache.- Returns:
- the message cache max size
-
getRestTimeout
public Duration getRestTimeout()
Gets the timeout to apply on each Discord REST request.- Returns:
- the REST timeout
-
getRestBufferSize
public int getRestBufferSize()
Gets the buffer size for Discord REST requests.- Returns:
- the REST buffer size
-
builder
public static BotConfig.Builder builder(String token)
Creates a new builder ofBotConfig
.- Parameters:
token
- the bot token- Returns:
- a new builder
- Throws:
NullPointerException
- if token is null
-
-