Class AudioChannelAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.AudioChannelAdapter
- All Implemented Interfaces:
TypeAdapter<net.dv8tion.jda.api.entities.channel.middleman.AudioChannel>
,BiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<net.dv8tion.jda.api.entities.channel.middleman.AudioChannel>>
public class AudioChannelAdapter
extends Object
implements TypeAdapter<net.dv8tion.jda.api.entities.channel.middleman.AudioChannel>
Type adapter for JDAs
AudioChannel
.-
Constructor Details
-
AudioChannelAdapter
public AudioChannelAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<net.dv8tion.jda.api.entities.channel.middleman.AudioChannel> apply(@NotNull @NotNull String raw, @NotNull @NotNull net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent event) Attempts to parse a String to aAudioChannel
. Accepts both the channel id and name.- Specified by:
apply
in interfaceBiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<net.dv8tion.jda.api.entities.channel.middleman.AudioChannel>> - Specified by:
apply
in interfaceTypeAdapter<net.dv8tion.jda.api.entities.channel.middleman.AudioChannel>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed
AudioChannel
or an empty Optional if the parsing fails
-