command / me.schlaubi.regnumutils.common.parsing / EntityResolver / resolveEntity

resolveEntity

@Nullable open static fun <T : IMentionable!> resolveEntity(@NotNull input: @NotNull String, @NotNull type: @NotNull MentionType, @NotNull idResolver: @NotNull Function<@NotNull String, @Nullable T?>, @NotNull nameResolver: @NotNull BiFunction<@NotNull String, Boolean!, @NotNull MutableCollection<T>>): @Nullable T?

Resolves an mentionable entity by a mention, it's id or it's name (case-sensitive).

Parameters

input - String: e.g an user input that should get parsed for mentions

type - MentionType: the net.dv8tion.jda.api.entities.Message.MentionType of the expected entity

idResolver - Function<String, T?>: a Function that can resolve that type of entity by its id

nameResolver - BiFunction<String, Boolean!, MutableCollection<T>>: a Function that can resolve that type of entity by its name

- the type of the entity

Return
T?: the entity or null if there was no entity found for that input

@Nullable open static fun <T : IMentionable!> resolveEntity(@NotNull input: @NotNull String, @NotNull type: @NotNull MentionType, @NotNull idResolver: @NotNull Function<@NotNull String, @Nullable T?>, @NotNull nameResolver: @NotNull BiFunction<@NotNull String, Boolean!, @NotNull MutableCollection<T>>, ignoreCase: Boolean): @Nullable T?

Resolves an mentionable entity by a mention, it's id or it's name.

Parameters

input - String: e.g an user input that should get parsed for mentions

type - MentionType: the net.dv8tion.jda.api.entities.Message.MentionType of the expected entity

idResolver - Function<String, T?>: a Function that can resolve that type of entity by its id

nameResolver - BiFunction<String, Boolean!, MutableCollection<T>>: a Function that can resolve that type of entity by its name

ignoreCase - Boolean: Whether the name should be resolved case-sensitive or not

- the type of the entity

Return
T?: the entity or null if there was no entity found for that input