Package-level declarations

Extension functions to aid in bot development.

Types

Link copied to clipboard

A collection of Regex for detecting discord strings

Link copied to clipboard
data class MessageParts(val guildId: Snowflake, val channelId: Snowflake, val messageId: Snowflake)

The 3 snowflake elements of a message link.

Link copied to clipboard
object TimeStamp

Generate discord timestamps.

Link copied to clipboard

Enum for discord timestamp styles.

Properties

Link copied to clipboard

A link to this user's default profile picture.

Link copied to clipboard
val User.fullName: String

A User's name and discriminator (if one exists) username or username#1234

Link copied to clipboard
val UserBehavior.mutualGuilds: Flow<Guild>

Get guilds shared between the user and the bot.

Link copied to clipboard
val User.pfpUrl: String

A link to this user's profile picture (or default).

Link copied to clipboard
val UserBehavior.profileLink: String

A Discord profile link for this user.

Functions

Link copied to clipboard
fun EmbedBuilder.addField(name: String, value: String)

Add a field to an embed. Shorthand for the equivalent builder.

Link copied to clipboard
fun EmbedBuilder.addInlineField(name: String, value: String)

Add an inline field to an embed. Shorthand for the equivalent builder.

Link copied to clipboard
suspend fun Message.addReactions(vararg reactions: ReactionEmoji)
suspend fun Message.addReactions(reactions: List<ReactionEmoji>)

Add multiple ReactionEmoji to a Message.

Link copied to clipboard
fun EmbedBuilder.author(user: User)

Create an author field from the given User. Set's the name, icon, and url.

Link copied to clipboard
fun ActionRowBuilder.button(label: String?, emoji: DiscordEmoji?, style: ButtonStyle = ButtonStyle.Secondary, disabled: Boolean = false, action: ButtonBuilder.InteractionButtonBuilder.() -> Unit)

Create an interaction button with a UUID.

Link copied to clipboard

Remove and return the first element in a mutable list.

Link copied to clipboard
fun Message.containsInvite(): Boolean

Checks if this message contains a Discord invite.

Whether this string contains a discord invite.

Link copied to clipboard
fun Message.containsURL(): Boolean

Checks if this message contains a URL.

Link copied to clipboard

Whether this string matches a URL regex.

Link copied to clipboard
suspend fun MessageChannelBehavior.createMenu(construct: suspend MenuBuilder.() -> Unit): Message

Create a new menu in a message channel.

Link copied to clipboard
fun User.descriptor(): String

User entity formatted to a readable String. username :: <@username>

Link copied to clipboard
suspend fun VoiceState.disconnect(): Member

Disconnect this Member from their VoiceChannel.

Link copied to clipboard
fun EmbedBuilder.footer(text: String, icon: String? = null)

Set the footer of an embed given its text and optional icon.

Link copied to clipboard
fun Message.getInvites(): List<String>

Find all invites in this message.

Return all discord invites in this string.

Link copied to clipboard
fun User.idDescriptor(): String

User entity formatted to a readable String. username :: 123456789123456789

Link copied to clipboard
inline fun <T : Event> intentsOf(): Intents

Convert an Event to its Intents.

Link copied to clipboard

Whether this string is a valid boolean value (true/false/t/f).

Link copied to clipboard
fun Message.isImagePost(): Boolean

Checks if this message is exclusively an image.

Link copied to clipboard
fun UserBehavior.isSelf(): Boolean

Checks if this User is itself.

Link copied to clipboard
suspend fun Message.jumpLink(): String?

Determine the Discord URL for this message (null if in a DM).

Link copied to clipboard
suspend fun Command.mentionOrNull(guild: Guild): String?

Create a discord mention for this command.

suspend fun GlobalSlashCommand.mentionOrNull(kord: Kord): String?

Create a discord mention for this global slash command.

suspend fun GuildSlashCommand.mentionOrNull(guild: Guild): String?

Create a discord mention for this guild slash command.

Link copied to clipboard
suspend fun Message.mentionsSomeone(): Boolean

Checks if this message mentions a user or role.

Link copied to clipboard
suspend fun VoiceState.move(channel: VoiceChannel): Member

Move this Member to a new VoiceChannel.

Link copied to clipboard

Create a string with a number and its respective singular/plural unit string.

Link copied to clipboard
suspend fun Message.replySilently(builder: suspend UserMessageCreateBuilder.() -> Unit): Message

Reply to this message with no mentions allowed.

Link copied to clipboard

Sanitize all mentions and replace them with their resolved discord names.

Link copied to clipboard
suspend fun UserBehavior.sendPrivateMessage(message: Any = "", embed: suspend EmbedBuilder.() -> Unit? = null): Message?

Send a private message to a user if possible.

Link copied to clipboard

User entity formatted to a readable String. <@username> (username)

Link copied to clipboard
fun <T> stringify(entity: T): String

Convert any generic type into a more readable String.

Link copied to clipboard
fun EmbedBuilder.thumbnail(url: String)

Set the thumbnail of an embed given a URL.

Link copied to clipboard
fun ReactionEmoji.toPartialEmoji(): DiscordPartialEmoji

Convert a ReactionEmoji to a DiscordPartialEmoji.

fun DiscordEmoji.toPartialEmoji(): DiscordPartialEmoji

Convert a DiscordEmoji to a DiscordPartialEmoji.

Link copied to clipboard
fun Long.toSnowflake(): Snowflake

Convert a Long ID to a Snowflake.

fun String.toSnowflake(): Snowflake

Convert a String ID or mention to a Snowflake.

Link copied to clipboard
fun String.toSnowflakeOrNull(): Snowflake?

Convert an ID or mention to a Snowflake.

Link copied to clipboard
fun Long.toTimeString(trimLeadingZeroes: Boolean = true, trimTrailingZeros: Boolean = true): String

Convert this long value to a time string.

Link copied to clipboard

Trim any type of mention into an ID.

Link copied to clipboard

Unwrap a message link into its MessageParts.

Link copied to clipboard
fun uuid(): String

Generate a random UUID String.