Class MemberAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.MemberAdapter
- All Implemented Interfaces:
TypeAdapter<Member>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<Member>>
Type adapter for JDAs
Member
.-
Constructor Details
-
MemberAdapter
public MemberAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<Member> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aMember
. Accepts both the member id and name.- Specified by:
apply
in interfaceBiFunction<String,
GenericInteractionCreateEvent, Optional<Member>> - Specified by:
apply
in interfaceTypeAdapter<Member>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed
Member
or an empty Optional if the parsing fails
-