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