Class MessageResolver
The MessageResolver combines all registered Resolver<String>
and following default resolvers:
PlaceholderResolver(priority = 1000)I18n(priority = 2000)EmojiResolver(priority = 3000)
Resolvers with lower priority will be executed first, e.g. PlaceholderResolver will
run before I18n.
Please note that this class is a helper and doesn't have own resolving logic, it's more of a pipeline of all string resolvers. 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 TypeMethodDescriptionintpriority()The priority of this resolver influences the order in which resolver are applied in a resolution pipeline.Applies all registeredResolver<String>to the given message with the passed locale and placeholders.
-
Constructor Details
-
MessageResolver
-
-
Method Details
-
resolve
Applies all registeredResolver<String>to the given message with the passed locale and placeholders. See class docs for more information. -
priority
public int priority()Description copied from interface:ResolverThe priority of this resolver influences the order in which resolver are applied in a resolution pipeline.
Currently, this only applies to
Resolver<String>, when usingMessageResolver(as JDA-Commands does internally). Generally speaking, resolvers with lower priority run first.If the priority isn't important (e.g. for
ComponentResolver) this should return0.
-