Class GuildMessageChannelAdapter
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.GuildMessageChannelAdapter
- All Implemented Interfaces:
TypeAdapter<GuildMessageChannel>
,BiFunction<String,
GenericInteractionCreateEvent, Optional<GuildMessageChannel>>
Type adapter for JDAs
GuildMessageChannel
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Optional
<GuildMessageChannel> apply
(@NotNull String raw, @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aGuildMessageChannel
.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
-
GuildMessageChannelAdapter
public GuildMessageChannelAdapter()
-
-
Method Details
-
apply
@NotNull public @NotNull Optional<GuildMessageChannel> apply(@NotNull @NotNull String raw, @NotNull @NotNull GenericInteractionCreateEvent event) Attempts to parse a String to aGuildMessageChannel
. Accepts both the channel id and name.- Specified by:
apply
in interfaceBiFunction<String,
GenericInteractionCreateEvent, Optional<GuildMessageChannel>> - Specified by:
apply
in interfaceTypeAdapter<GuildMessageChannel>
- Parameters:
raw
- the String to parseevent
- theGenericInteractionCreateEvent
- Returns:
- the parsed
GuildMessageChannel
or an empty Optional if the parsing fails
-