Package com.github.twitch4j.pubsub
Class TwitchPubSubBuilder
java.lang.Object
com.github.twitch4j.pubsub.TwitchPubSubBuilder
Twitch PubSub Builder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Twitch PubSub Clientstatic TwitchPubSubBuilderbuilder()Initialize the builderUser IDs of Bot Owners for applyingCommandPermission.OWNERWebSocket Connection Backoff StrategyClass<? extends com.github.philippheuer.events4j.api.service.IEventHandler>EventManagerEvent ManagerProxy ConfigurationScheduler Thread Pool ExecutorWebsocketConnectionintWebsocket Close Delay in ms (0 = minimum)intWebSocket RFC Ping Period in ms (0 = disabled)setBotOwnerIds(Collection<String> botOwnerIds) User IDs of Bot Owners for applyingCommandPermission.OWNERwithBotOwnerId(String userId) With a Bot Owner's User IDwithBotOwnerIds(Collection<String> botOwnerIds) With multiple Bot Owner User IDswithConnectionBackoffStrategy(IBackoffStrategy connectionBackoffStrategy) WebSocket Connection Backoff StrategywithDefaultEventHandler(Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> defaultEventHandler) EventManagerwithEventManager(EventManager eventManager) Event ManagerwithProxyConfig(ProxyConfig proxyConfig) Proxy ConfigurationwithScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor) Scheduler Thread Pool Executorprotected TwitchPubSubBuilderwithWebsocketConnection(WebsocketConnection websocketConnection) WebsocketConnectionwithWsCloseDelay(int wsCloseDelay) Websocket Close Delay in ms (0 = minimum)withWsPingPeriod(int wsPingPeriod) WebSocket RFC Ping Period in ms (0 = disabled)
-
Method Details
-
builder
Initialize the builder- Returns:
- Twitch PubSub Builder
-
build
Twitch PubSub Client- Returns:
- TwitchPubSub
-
withBotOwnerId
With a Bot Owner's User ID- Parameters:
userId- the user id- Returns:
- TwitchPubSubBuilder
-
withBotOwnerIds
With multiple Bot Owner User IDs- Parameters:
botOwnerIds- the user ids- Returns:
- TwitchPubSubBuilder
-
getWebsocketConnection
WebsocketConnectioncan be used to inject a mocked connection into the TwitchChat instance
-
getEventManager
Event Manager -
getDefaultEventHandler
public Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> getDefaultEventHandler()EventManager -
getScheduledThreadPoolExecutor
Scheduler Thread Pool Executor -
getProxyConfig
Proxy Configuration -
getBotOwnerIds
User IDs of Bot Owners for applyingCommandPermission.OWNER -
getWsPingPeriod
public int getWsPingPeriod()WebSocket RFC Ping Period in ms (0 = disabled) -
getWsCloseDelay
public int getWsCloseDelay()Websocket Close Delay in ms (0 = minimum)- See Also:
-
getConnectionBackoffStrategy
WebSocket Connection Backoff Strategy -
withWebsocketConnection
WebsocketConnectioncan be used to inject a mocked connection into the TwitchChat instance
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEventManager
Event Manager- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDefaultEventHandler
public TwitchPubSubBuilder withDefaultEventHandler(Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> defaultEventHandler) EventManager- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withScheduledThreadPoolExecutor
public TwitchPubSubBuilder withScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor) Scheduler Thread Pool Executor- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withProxyConfig
Proxy Configuration- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
setBotOwnerIds
User IDs of Bot Owners for applyingCommandPermission.OWNER- Returns:
this.
-
withWsPingPeriod
WebSocket RFC Ping Period in ms (0 = disabled)- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withWsCloseDelay
Websocket Close Delay in ms (0 = minimum)- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed). - See Also:
-
withConnectionBackoffStrategy
public TwitchPubSubBuilder withConnectionBackoffStrategy(IBackoffStrategy connectionBackoffStrategy) WebSocket Connection Backoff Strategy- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-