UserLocaleProvider

@InterfacedService(acceptMultiple = false)
interface UserLocaleProvider(source)

Provides the locale of a user in a Discord interaction.

You may provide a custom implementation, for example, if a user's locale depends on some external setting.

This returns interaction.getUserLocale().toLocale() by default.

Usage

Register your instance as a service with @BService.

See also

Functions

Link copied to clipboard
abstract fun getLocale(interaction: Interaction): Locale