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