lazy

fun lazy(assetPattern: String, emojiName: String): Lazy<ApplicationEmoji>(source)

Lazily retrieves an emoji named emojiName, created from the assetPattern found in the basePath of your class.

The basePath is taken from the first @AppEmojiContainer found in the call stack, typically the caller of this function.

This cannot be used alongside non-lazy methods (get and getValue).

Parameters

assetPattern

The glob pattern which matches a single file, includes the extension

emojiName

The name of the emoji uploaded on Discord, defaults to assetPattern without its extension and converted from camelCase to snake_case, must be between 2 and EMOJI_NAME_MAX_LENGTH and only have alphanumerics with dashes

Throws

If @AppEmojiContainer is not found in the call stack

If emojiName has invalid characters

If an emoji with the same name was already registered

If the emojis were already loaded


fun lazy(basePath: String, assetPattern: String, emojiName: String): Lazy<ApplicationEmoji>(source)

Lazily retrieves an emoji named emojiName, created from the assetPattern found in the basePath.

This cannot be used alongside non-lazy methods (get and getValue).

Parameters

basePath

Path at which the file can be searched in; must start with a / and NOT end with a /

assetPattern

The glob pattern which matches a single file, includes the extension

emojiName

The name of the emoji uploaded on Discord, defaults to assetPattern without its extension and converted from camelCase to snake_case, must be between 2 and EMOJI_NAME_MAX_LENGTH and only have alphanumerics with dashes

Throws

If emojiName has invalid characters

If an emoji with the same name was already registered

If the emojis were already loaded


fun lazy(baseline: KProperty<ApplicationEmoji>, basePath: String? = null, assetPattern: String? = null, emojiName: String? = null): Lazy<ApplicationEmoji>(source)

Lazily retrieves an application emoji for the current property.

This function registers the emoji with the following values, which can be overridden:

This cannot be used alongside non-lazy methods (get and getValue).

Parameters

baseline

Property from which to take the base path, asset name and emoji name, must be the current property

basePath

Path at which the file can be searched in; must start with a / and NOT end with a /

assetPattern

The glob pattern which matches a single file, includes the extension

emojiName

The name of the emoji uploaded on Discord, defaults to assetPattern without its extension and converted from camelCase to snake_case, must be between 2 and EMOJI_NAME_MAX_LENGTH and only have alphanumerics with dashes

Throws

If emojiName has invalid characters

If an emoji with the same name was already registered

If the baseline was already passed, remember to pass the property this is used on