Klasse TwitchPubSubBuilder

java.lang.Object
com.github.twitch4j.pubsub.TwitchPubSubBuilder

public class TwitchPubSubBuilder extends Object
Twitch PubSub Builder
  • Methodendetails

    • builder

      public static TwitchPubSubBuilder builder()
      Initialize the builder
      Gibt zurück:
      Twitch PubSub Builder
    • build

      public TwitchPubSub build()
      Twitch PubSub Client
      Gibt zurück:
      TwitchPubSub
    • withBotOwnerId

      public TwitchPubSubBuilder withBotOwnerId(String userId)
      With a Bot Owner's User ID
      Parameter:
      userId - the user id
      Gibt zurück:
      TwitchPubSubBuilder
    • withBotOwnerIds

      public TwitchPubSubBuilder withBotOwnerIds(Collection<String> botOwnerIds)
      With multiple Bot Owner User IDs
      Parameter:
      botOwnerIds - the user ids
      Gibt zurück:
      TwitchPubSubBuilder
    • getWebsocketConnection

      public WebsocketConnection getWebsocketConnection()
      WebsocketConnection

      can be used to inject a mocked connection into the TwitchChat instance

    • getEventManager

      public EventManager getEventManager()
      Event Manager
    • getDefaultEventHandler

      public Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> getDefaultEventHandler()
      EventManager
    • getScheduledThreadPoolExecutor

      public ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor()
      Scheduler Thread Pool Executor
    • getProxyConfig

      public ProxyConfig getProxyConfig()
      Proxy Configuration
    • getBotOwnerIds

      public Collection<String> getBotOwnerIds()
      User IDs of Bot Owners for applying CommandPermission.OWNER
    • getWsPingPeriod

      public int getWsPingPeriod()
      WebSocket RFC Ping Period in ms (0 = disabled)
    • getWsCloseDelay

      public int getWsCloseDelay()
      Websocket Close Delay in ms (0 = minimum)
      Siehe auch:
    • getConnectionBackoffStrategy

      public IBackoffStrategy getConnectionBackoffStrategy()
      WebSocket Connection Backoff Strategy
    • getFallbackTopicHandler

      public Consumer<PubSubResponsePayload> getFallbackTopicHandler()
      Consumer of PubSub messages for topics that did not match internal handlers.

      By default, Twitch4J simply logs these payloads, but this consumer can be utilized by users to implement new logic, such as support for more undocumented topics.

    • withWebsocketConnection

      protected TwitchPubSubBuilder withWebsocketConnection(WebsocketConnection websocketConnection)
      WebsocketConnection

      can be used to inject a mocked connection into the TwitchChat instance

      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withEventManager

      public TwitchPubSubBuilder withEventManager(EventManager eventManager)
      Event Manager
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withDefaultEventHandler

      public TwitchPubSubBuilder withDefaultEventHandler(Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> defaultEventHandler)
      EventManager
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withScheduledThreadPoolExecutor

      public TwitchPubSubBuilder withScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor)
      Scheduler Thread Pool Executor
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withProxyConfig

      public TwitchPubSubBuilder withProxyConfig(ProxyConfig proxyConfig)
      Proxy Configuration
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • setBotOwnerIds

      public TwitchPubSubBuilder setBotOwnerIds(Collection<String> botOwnerIds)
      User IDs of Bot Owners for applying CommandPermission.OWNER
      Gibt zurück:
      this.
    • withWsPingPeriod

      public TwitchPubSubBuilder withWsPingPeriod(int wsPingPeriod)
      WebSocket RFC Ping Period in ms (0 = disabled)
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withWsCloseDelay

      public TwitchPubSubBuilder withWsCloseDelay(int wsCloseDelay)
      Websocket Close Delay in ms (0 = minimum)
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
      Siehe auch:
    • withConnectionBackoffStrategy

      public TwitchPubSubBuilder withConnectionBackoffStrategy(IBackoffStrategy connectionBackoffStrategy)
      WebSocket Connection Backoff Strategy
      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withFallbackTopicHandler

      public TwitchPubSubBuilder withFallbackTopicHandler(Consumer<PubSubResponsePayload> fallbackTopicHandler)
      Consumer of PubSub messages for topics that did not match internal handlers.

      By default, Twitch4J simply logs these payloads, but this consumer can be utilized by users to implement new logic, such as support for more undocumented topics.

      Gibt zurück:
      a clone of this object, except with this updated property (returns this if an identical value is passed).