IMessageSourceFactory

A factory of IMessageSource, this must be extended by an interface annotated with @MessageSourceFactory.

An exception will be thrown if any additional abstract (i.e. without a default) method is found.

No implementation required for interfaces extending this, they will be generated at runtime.

Parameters

T

Type of the generated message sources

Properties

Link copied to clipboard
abstract val bundleName: String

The name of the bundle this factory will generate message sources for

Link copied to clipboard
abstract val locales: Set<Locale>

The effective locales available for this bundle.

Functions

Link copied to clipboard
open fun create(guildLocale: Locale): T

Creates a new message source using the provided guild locale, and no user locale.

abstract fun create(event: MessageReceivedEvent): T

Creates a new message source using the provided message event.

abstract fun create(interaction: Interaction): T

Creates a new message source using the provided interaction.

abstract fun create(guildLocale: Locale, userLocale: Locale?): T

Creates a new message source using the provided guild and user locale.