Bot

class Bot(token: String, packageName: String)

Backing class for bot function.

Constructors

Link copied to clipboard
fun Bot(token: String, packageName: String)

Functions

Link copied to clipboard
fun configure(config: suspend SimpleConfiguration.() -> Unit)

Modify simple configuration options.

Link copied to clipboard
inline fun <T : Data> data(path: String, fallback: () -> T): T

Read JSON Data from a path if it exists; create it otherwise.

Link copied to clipboard
fun inject(vararg injectionObjects: Any)

Inject objects into the dependency injection pool.

Link copied to clipboard
fun localeOf(language: Language, localeBuilder: Locale.() -> Unit)

Configure the locale for this bot.

Link copied to clipboard
fun mentionEmbed(slashName: String? = "info", construct: suspend EmbedBuilder.(DiscordContext) -> Unit? = defaultMentionEmbed)

An embed that will be sent anytime someone (solely) mentions the bot.

Link copied to clipboard
fun onException(handler: suspend DktException<*>.() -> Unit)

Function to handle any exception that occur during runtime.

Link copied to clipboard
fun onStart(start: suspend Discord.() -> Unit)

When setup is complete, execute this block.

Link copied to clipboard
fun prefix(construct: suspend DiscordContext.() -> String)

Determine the prefix in a given context.

Link copied to clipboard
fun presence(presence: PresenceBuilder.() -> Unit)

Configure the Discord presence for this bot.