Class EmojiResolver
The EmojiResolver replaces emoji aliases in strings with their formatted value.
An emoji alias is just the discord alias (either Unicode oder app emoji)
enclosed by a colon :. For example the Unicode alias :joy: will be replaced by 😂 and the
app emoji :app_emote: by its uploaded file.
Normally it shouldn't be necessary to escape the colons in messages (that shouldn't be an emoji alias), but in case any troubles occur you can
just prefix it with \ (in java \\) to escape it.
Supported are all discord emojis, their skin tone variants and the app emotes for this bot. App emotes with the same name as a Unicode one will override later.
-
Constructor Summary
ConstructorsConstructorDescriptionEmojiResolver(Collection<ApplicationEmoji> applicationEmojis) Constructs a new instance ofEmojiResolverwith the given application emojis and all Unicode emojis supported by discord. -
Method Summary
Modifier and TypeMethodDescriptionintpriority()The priority of this resolver influences the order in which resolver are applied in a resolution pipeline.Resolves the emoji aliases of a string according to the javadocs of this class.Resolves the given object for the provided locale.
-
Constructor Details
-
EmojiResolver
Constructs a new instance ofEmojiResolverwith the given application emojis and all Unicode emojis supported by discord. If one of the passed application emojis has the same alias as a Unicode emoji, the app emojis takes precedence.- Parameters:
applicationEmojis- a list of all application emojis of this bot
-
-
Method Details
-
resolve
-
resolve
Description copied from interface:ResolverResolves the given object for the provided locale. -
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.
-