Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Utility class to convert between Kotlin and Java reflection objects.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ClassInfo.shortQualifiedName: <Error class: unknown class>
val Class<*>.shortQualifiedName: <Error class: unknown class>
val KClass<*>.shortQualifiedName: <Error class: unknown class>
Link copied to clipboard
val MethodInfo.shortSignature: String
Link copied to clipboard
val MethodInfo.shortSignatureNoSrc: String
Link copied to clipboard
val ClassInfo.simpleNestedName: <Error class: unknown class>

Functions

Link copied to clipboard
fun <T> arrayOfSize(size: Int): ArrayList<T>
Link copied to clipboard

Converts this JEmoji Emoji into a JDA UnicodeEmoji.

Link copied to clipboard
inline suspend fun <T : GenericEvent> JDA.await(crossinline filter: (T) -> Boolean = { true }): T

Suspends until an event of type T satisfying the filter is received on this shard, then returns it.

inline suspend fun <T : GenericEvent> ShardManager.await(crossinline filter: (T) -> Boolean = { true }): T

Suspends until an event of type T satisfying the filter is received on any shard, then returns it.

Link copied to clipboard
fun <K, V> MutableMap<K, V>.computeIfAbsentOrNull(key: K, block: (K) -> V): V?

Returns null if the element already exists

Link copied to clipboard
fun <T> Iterable<T>.containsAny(vararg elements: T): Boolean
fun <T> Iterable<T>.containsAny(elements: Iterable<T>): Boolean
Link copied to clipboard
inline fun <T : Enum<T>, V> enumMapOf(): EnumMap<T, V>
Link copied to clipboard
inline fun <T : Enum<T>> enumSetOf(): EnumSet<T>
inline fun <T : Enum<T>> enumSetOf(vararg elems: T): EnumSet<T>
Link copied to clipboard
inline fun <T : Enum<T>> enumSetOfAll(): EnumSet<T>
Link copied to clipboard
fun <A : Annotation> findAllAnnotations(element: KAnnotatedElement, annotationType: Class<A>, directOverrides: Boolean = true): List<A>

Finds all annotations of type A from the annotated element.

Link copied to clipboard
inline fun <A : Annotation> KAnnotatedElement.findAllAnnotations(directOverrides: Boolean = true): List<A>
fun <A : Annotation> KAnnotatedElement.findAllAnnotations(annotationType: KClass<A>, directOverrides: Boolean = true): List<A>

Finds all annotations of type A from the annotated element.

Link copied to clipboard

Finds all annotations meta-annotated with A from the annotated element.

Link copied to clipboard

Finds all annotations meta-annotated with A from the annotated element.

Link copied to clipboard
fun <A : Annotation> findAnnotationRecursive(element: KAnnotatedElement, annotationType: Class<A>): A?

Finds a single annotation of type A from the annotated element.

Link copied to clipboard

Finds a single annotation of type A from the annotated element.

Link copied to clipboard
inline fun <T, R> Iterable<T>.flatMap(transform: (T) -> Array<R>): List<R>
Link copied to clipboard
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapTo(destination: C, transform: (T) -> Array<R>): C
Link copied to clipboard

Finds all annotations from the annotated element.

Link copied to clipboard
@JvmName(name = "getAllAnnotationsKotlin")
fun KAnnotatedElement.getAllAnnotations(): List<Annotation>

Finds all annotations from the annotated element.

Link copied to clipboard
fun getMissingPermissions(requiredPerms: EnumSet<Permission>, permissionHolder: IPermissionHolder, channel: GuildChannel): Set<Permission>

Computes the missing permissions from the specified permission holder, if you plan on showing them, be sure to use PermissionLocalization.localize.

Link copied to clipboard
fun KFunction<*>.getParameters(parameterNames: List<String>, qualifiedTypes: Boolean): String
Link copied to clipboard
fun KFunction<*>.getSignature(parameterNames: List<String> = listOf(), qualifiedClass: Boolean = false, qualifiedTypes: Boolean = false, returnType: Boolean = false, source: Boolean = true): String
Link copied to clipboard
fun hasAnnotationRecursive(element: KAnnotatedElement, annotationType: Class<out Annotation>): Boolean

Returns true if this element is annotated with annotationType.

Link copied to clipboard

Returns true if this element is annotated with A.

Returns true if this element is annotated with annotationType.

Link copied to clipboard
fun KClass<*>.isAssignableFrom(clazz: Class<*>): <Error class: unknown class>
fun KClass<*>.isAssignableFrom(kClass: KClass<*>): <Error class: unknown class>
Link copied to clipboard
inline fun <T : Any> Class<*>.isSubclassOf(): Boolean
inline fun <T : Any> KClass<*>.isSubclassOf(): Boolean
fun KClass<*>.isSubclassOf(kClass: KClass<*>): Boolean
Link copied to clipboard
fun KClass<*>.isSubclassOfAny(vararg classes: KClass<*>): Boolean
Link copied to clipboard
inline fun <T : Any> KClass<*>.isSuperclassOf(): Boolean
Link copied to clipboard
fun <T> Iterable<T>.joinAsList(linePrefix: String = " -", transform: (T) -> CharSequence? = null): <Error class: unknown class>
Link copied to clipboard
fun <T> Iterable<T>.joinWithQuote(transform: (T) -> CharSequence? = null): <Error class: unknown class>
Link copied to clipboard
@JvmName(name = "lazyJdaUnicodeEmoji")
fun lazyUnicodeEmoji(supplier: () -> UnicodeEmoji): Lazy<UnicodeEmoji>

Lazily converts the supplied Emoji into a JDA UnicodeEmoji.

@JvmName(name = "lazyJEmojiUnicodeEmoji")
fun lazyUnicodeEmoji(supplier: () -> Emoji): Lazy<UnicodeEmoji>

Lazily converts the supplied Emoji into a JDA UnicodeEmoji.

Link copied to clipboard
inline fun <T : GenericEvent> JDA.listener(timeout: Duration? = null, crossinline block: suspend CoroutineEventListener.(event: T) -> Unit)

Creates and registers an event listener fired for every event of type T on this shard.

inline fun <T : GenericEvent> ShardManager.listener(timeout: Duration? = null, crossinline block: suspend CoroutineEventListener.(event: T) -> Unit)

Creates and registers an event listener fired for every event of type T on every shard.

Link copied to clipboard
inline fun <T : Any> KotlinLogging.loggerOf(): KLogger
Link copied to clipboard
inline fun <T, R> Array<T>.mapToArray(transform: (T) -> R): Array<R>
inline fun <T, R> Collection<T>.mapToArray(transform: (T) -> R): Array<R>
Link copied to clipboard
fun namedDefaultScope(coroutineName: String, executor: Executor, job: Job? = null, errorHandler: CoroutineExceptionHandler? = null, context: CoroutineContext = EmptyCoroutineContext): CoroutineScope
fun namedDefaultScope(name: String, corePoolSize: Int, job: Job? = null, errorHandler: CoroutineExceptionHandler? = null, context: CoroutineContext = EmptyCoroutineContext): CoroutineScope

Creates a CoroutineScope with incremental thread naming.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <K, V> MutableMap<K, V>.putIfAbsentOrNull(key: K, value: V): V?

Returns null if the element already exists

Link copied to clipboard

Reads a resource relative from the calling class.

Link copied to clipboard

Reads a resource relative as a string from the calling class.

Link copied to clipboard

Configures refill that does refill of tokens in greedy manner, it will try to add the tokens to bucket as soon as possible.

Link copied to clipboard

Configures refill that does refill of tokens in intervally manner.

Link copied to clipboard

Configures refill that does refill of tokens in intervally manner. "Intervally" in opposite to "greedy" will wait until whole period will be elapsed before regenerate tokens.

Link copied to clipboard
fun Class<*>.toBoxed(): Class<*>
fun KClass<*>.toBoxed(): KClass<*>
Link copied to clipboard
Link copied to clipboard
fun <K, V> Map<K, V>.toImmutableMap(): Map<K, V>
Link copied to clipboard
fun <T> Set<T>.toImmutableSet(): Set<T>
Link copied to clipboard
inline fun <T : Any> typeReferenceOf(): TypeReference<T>

Creates a TypeReference of type T.

Link copied to clipboard
Link copied to clipboard
fun <R> withResource(url: String, block: (InputStream) -> R): R

Reads a resource relative from the calling class.