Class MessageResolver
java.lang.Object
com.github.kaktushose.jda.commands.message.MessageResolver
The MessageResolver combines I18n.localize(Locale, String, Entry...)
and
EmojiResolver.resolve(String)
.
It will resolve the message in following order:
- resolve placeholders with help of
PlaceholderResolver
- do localization with help of
I18n
- resolve emojis with help
EmojiResolver
Please note that this class is a helper and doesn't have own resolving logic, it's more of a pipeline
to EmojiResolver
and I18n
. It is not intended to be directly used by end users but part of the public api
to allow manual execution of the frameworks resolving logic for dynamic values if needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the underlyingEmojiResolver
instancei18n()
Gets the underlyingI18n
instanceFirst resolves the variables in the given message (seePlaceholderResolver.resolve(String, Map)
), then localizes the resulting message (seeI18n.localize(Locale, String, Entry...)
) and lastly attempts to resolve emojis (seeEmojiResolver.resolve(String)
).First resolves the variables in the given message (seePlaceholderResolver.resolve(String, Map)
), then localizes the resulting message (seeI18n.localize(Locale, String, Entry...)
) and lastly attempts to resolve emojis (seeEmojiResolver.resolve(String)
).
-
Constructor Details
-
MessageResolver
-
-
Method Details
-
resolve
First resolves the variables in the given message (seePlaceholderResolver.resolve(String, Map)
), then localizes the resulting message (seeI18n.localize(Locale, String, Entry...)
) and lastly attempts to resolve emojis (seeEmojiResolver.resolve(String)
).- Parameters:
message
- the message to be resolvedlocale
- the locale to use for i18nplaceholder
- the placeholders to use for i18n- Returns:
- the resolved message
-
resolve
First resolves the variables in the given message (seePlaceholderResolver.resolve(String, Map)
), then localizes the resulting message (seeI18n.localize(Locale, String, Entry...)
) and lastly attempts to resolve emojis (seeEmojiResolver.resolve(String)
).- Parameters:
message
- the message to be resolvedlocale
- the locale to use for i18nplaceholder
- the placeholders to use for i18n- Returns:
- the resolved message
-
i18n
-
emojiResolver
Gets the underlyingEmojiResolver
instance- Returns:
- the used
EmojiResolver
instance
-