Class KoeOptionsBuilder

java.lang.Object
moe.kyokobot.koe.KoeOptionsBuilder
Direct Known Subclasses:
KoeOptionsBuilderExperimental

public class KoeOptionsBuilder extends Object
  • Field Details

    • eventLoopGroup

      protected io.netty.channel.EventLoopGroup eventLoopGroup
    • socketChannelClass

      protected Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass
    • datagramChannelClass

      protected Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelClass
    • byteBufAllocator

      protected io.netty.buffer.ByteBufAllocator byteBufAllocator
    • gatewayVersion

      protected GatewayVersion gatewayVersion
    • framePollerFactory

      protected FramePollerFactory framePollerFactory
    • codecRegistry

      protected CodecRegistry codecRegistry
    • experimental

      protected boolean experimental
    • highPacketPriority

      protected boolean highPacketPriority
    • deafened

      protected boolean deafened
    • enableWSSPortOverride

      protected boolean enableWSSPortOverride
    • verifyWSSHostname

      protected boolean verifyWSSHostname
    • enableDAVE

      protected boolean enableDAVE
  • Constructor Details

    • KoeOptionsBuilder

      protected KoeOptionsBuilder()
  • Method Details

    • setEventLoopGroup

      public KoeOptionsBuilder setEventLoopGroup(@NotNull io.netty.channel.EventLoopGroup eventLoopGroup)
      Sets an implementation of Netty EventLoopGroup to use for the Koe client. Defaults to Epoll if available (Linux) or NIO on everything else.. Use this if you need KQueue on macOS/BSD hosts or other native transport with Koe.
      Parameters:
      eventLoopGroup - An instance of EventLoopGroup to use for the Koe client.
    • setSocketChannelClass

      public KoeOptionsBuilder setSocketChannelClass(@NotNull Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass)
      Sets a class of Netty SocketChannel to use for the Koe client. Defaults to EpollSocketChannel if Epoll is available (Linux) or NioSocketChannel on everything else. Use this if you need KQueue on macOS/BSD hosts or other native transport with Koe.
      Parameters:
      socketChannelClass - An implementation class of SocketChannel to use for the Koe client. Same as class passed into AbstractBootstrap.channel(Class) method when creating socket channels.
    • setDatagramChannelClass

      public KoeOptionsBuilder setDatagramChannelClass(@NotNull Class<? extends io.netty.channel.socket.DatagramChannel> datagramChannelClass)
      Sets a class of Netty DatagramChannel to use for the Koe client. Defaults to EpollDatagramChannel if Epoll is available (Linux) or NioDatagramChannel on everything else. Use this if you need KQueue on macOS/BSD hosts or other native transport with Koe.
      Parameters:
      datagramChannelClass - An implementation class of DatagramChannel to use for the Koe client. Same as class passed into AbstractBootstrap.channel(Class) method when creating datagram channels.
    • setByteBufAllocator

      public KoeOptionsBuilder setByteBufAllocator(@NotNull io.netty.buffer.ByteBufAllocator byteBufAllocator)
      Sets a Netty ByteBufAllocator to use for the Koe client. Defaults to PooledByteBufAllocator.
      Parameters:
      byteBufAllocator - An instance of ByteBufAllocator to use for the Koe client.
    • setGatewayVersion

      public KoeOptionsBuilder setGatewayVersion(@NotNull GatewayVersion gatewayVersion)
      Sets the gateway version to use for the Koe client.
      Parameters:
      gatewayVersion - An instance of GatewayVersion to use for the Koe client.
    • setFramePollerFactory

      public KoeOptionsBuilder setFramePollerFactory(@NotNull FramePollerFactory framePollerFactory)
      Sets a factory for creating frame pollers. Defaults to NettyFramePollerFactory.
      Parameters:
      framePollerFactory - An instance of FramePollerFactory to use for the Koe client.
    • setCodecRegistry

      public KoeOptionsBuilder setCodecRegistry(@NotNull CodecRegistry codecRegistry)
      Sets a custom codec registry. Useful for registering custom codecs or removing built-in ones. Defaults to DefaultCodecRegistry with built-in codecs.
      Parameters:
      codecRegistry - An instance of CodecRegistry to use for the Koe client.
    • setHighPacketPriority

      public KoeOptionsBuilder setHighPacketPriority(boolean highPacketPriority)
      Sets whether to set IP_TOS flags to request high priority/low-delay for sent RTP packets. Defaults to true.
    • setDeafened

      public void setDeafened(boolean deafened)
      Sets whether the client should be deafened by default. Defaults to false.
    • setEnableWSSPortOverride

      public KoeOptionsBuilder setEnableWSSPortOverride(boolean enableWSSPortOverride)
      Sets whether to enable port :80 -> :443 override for voice server endpoint passed in VoiceServerInfo Defaults to true.
    • setVerifyWSSHostname

      public KoeOptionsBuilder setVerifyWSSHostname(boolean verifyWSSHostname)
      Sets whether to verify the server certificate hostname for WSS voice gateway connections. Defaults to true. Set to false only for custom or self-signed voice endpoints.
      Parameters:
      verifyWSSHostname - true to verify hostname (default), false to disable verification
    • setDAVEEnabled

      public KoeOptionsBuilder setDAVEEnabled(boolean enabled)
      Sets whether End-to-End encryption using Discord's DAVE protocol is enabled. Defaults to true.
    • create

      public KoeOptions create()