Class GuildChannelAdapter

java.lang.Object
com.github.kaktushose.jda.commands.dispatching.adapter.impl.GuildChannelAdapter
All Implemented Interfaces:
TypeAdapter<net.dv8tion.jda.api.entities.channel.middleman.GuildChannel>, BiFunction<String,net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent,Optional<net.dv8tion.jda.api.entities.channel.middleman.GuildChannel>>

public class GuildChannelAdapter extends Object implements TypeAdapter<net.dv8tion.jda.api.entities.channel.middleman.GuildChannel>
Type adapter for JDAs GuildChannel.
  • Constructor Details

    • GuildChannelAdapter

      public GuildChannelAdapter()
  • Method Details

    • apply

      @NotNull public @NotNull Optional<net.dv8tion.jda.api.entities.channel.middleman.GuildChannel> apply(@NotNull @NotNull String raw, @NotNull @NotNull net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent event)
      Attempts to parse a String to a GuildChannel. Accepts both the channel id and name.
      Specified by:
      apply in interface BiFunction<String,net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent,Optional<net.dv8tion.jda.api.entities.channel.middleman.GuildChannel>>
      Specified by:
      apply in interface TypeAdapter<net.dv8tion.jda.api.entities.channel.middleman.GuildChannel>
      Parameters:
      raw - the String to parse
      event - the GenericInteractionCreateEvent
      Returns:
      the parsed GuildChannel or an empty Optional if the parsing fails