Package-level declarations

Types

Link copied to clipboard

Class storing time units against values, to be applied to a time later on.

Link copied to clipboard

Serializer that converts ChronoContainers between comma-separated name:amount string pairs.

Link copied to clipboard
class J8DurationCoalescingConverter(val longHelp: Boolean = true, val positiveOnly: Boolean = true, shouldThrow: Boolean = false, var validator: <Error class: unknown class><ChronoContainer> = null) : CoalescingConverter<ChronoContainer>

Coalescing argument converter for Java 8 Duration arguments.

Link copied to clipboard
class J8DurationConverter(val longHelp: Boolean = true, val positiveOnly: Boolean = true, var validator: <Error class: unknown class><ChronoContainer> = null) : SingleConverter<ChronoContainer>

Argument converter for Java 8 Duration arguments.

Link copied to clipboard

Object in charge of parsing strings into ChronoContainers, using translated locale-aware units.

Link copied to clipboard

Simple object that caches translated time units per locale.

Functions

Link copied to clipboard
fun formatChronoContainer(container: ChronoContainer, locale: Locale, relativeTo: LocalDateTime = LocalDateTime.now()): String?

Function in charge of formatting ChronoContainer duration objects into human-readable form, taking locales and translations into account.

Link copied to clipboard
fun Instant.toDiscord(format: TimestampType = TimestampType.Default): String

Format the given Instant to Discord's automatically-formatted timestamp format. This will return a String that you can include in your messages, which Discord should automatically format for users based on their locale.

Link copied to clipboard
suspend fun ChronoContainer.toHuman(context: CommandContext, relativeTo: LocalDateTime = LocalDateTime.now()): String?
fun ChronoContainer.toHuman(locale: Locale, relativeTo: LocalDateTime = LocalDateTime.now()): String?

Given a Duration, this function will return a String (or null if it represents less than 1 second).