Class VoiceChannelAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.VoiceChannelAdapter
- All Implemented Interfaces:
TypeAdapter<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel>
,BiFunction<String,
net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent, Optional<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel>>
public class VoiceChannelAdapter
extends Object
implements TypeAdapter<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel>
Type adapter for JDAs
VoiceChannel
.-
Constructor Details
-
VoiceChannelAdapter
public VoiceChannelAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel> apply(@NotNull @NotNull String raw, @NotNull @NotNull net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent event) Attempts to parse a String to aVoiceChannel
. 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.concrete.VoiceChannel>> - Specified by:
apply
in interfaceTypeAdapter<net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed
VoiceChannel
or an empty Optional if the parsing fails
-