Class AudioChannelAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.AudioChannelAdapter
- All Implemented Interfaces:
TypeAdapter<AudioChannel>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<AudioChannel>>
Type adapter for JDAs
AudioChannel
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional
<AudioChannel> apply
(@NotNull String raw, @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aAudioChannel
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
AudioChannelAdapter
public AudioChannelAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<AudioChannel> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aAudioChannel
. Accepts both the channel id and name.- Specified by:
apply
in interfaceBiFunction<String,
GenericInteractionCreateEvent, Optional<AudioChannel>> - Specified by:
apply
in interfaceTypeAdapter<AudioChannel>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed
AudioChannel
or an empty Optional if the parsing fails
-