Package com.github.twitch4j.chat
Class TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C extends TwitchChatConnectionPool,B extends TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C,B>>
java.lang.Object
com.github.twitch4j.common.pool.AbstractConnectionPool.AbstractConnectionPoolBuilder<C,C2,B>
com.github.twitch4j.common.pool.SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder<C,X,Y,Z,C2,B2>
com.github.twitch4j.common.pool.TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<TwitchChat,String,String,Boolean,TwitchChatBuilder,C,B>
com.github.twitch4j.chat.TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C,B>
- Enclosing class:
- TwitchChatConnectionPool
public abstract static class TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C extends TwitchChatConnectionPool,B extends TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C,B>>
extends TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<TwitchChat,String,String,Boolean,TwitchChatBuilder,C,B>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthRateLimit
(io.github.bucket4j.Bandwidth authRateLimit) Custom RateLimit for AUTHautomaticallyPartOnBan
(boolean automaticallyPartOnBan) Deprecated.use removeChannelOnJoinFailure via advancedConfiguration instead.abstract C
build()
chatAccount
(@NonNull Supplier<com.github.philippheuer.credentialmanager.domain.OAuth2Credential> chatAccount) Provides a chat account to be used when constructing a newTwitchChat
instance.chatRateLimit
(io.github.bucket4j.Bandwidth chatRateLimit) Custom RateLimit for ChatMessagesconnectionBackoffStrategy
(IBackoffStrategy connectionBackoffStrategy) WebSocket Connection Backoff StrategyjoinRateLimit
(io.github.bucket4j.Bandwidth joinRateLimit) Custom RateLimit for JOIN/PARTperChannelRateLimit
(io.github.bucket4j.Bandwidth perChannelRateLimit) Custom RateLimit for Messages per Channelprotected abstract B
self()
toString()
whisperRateLimit
(io.github.bucket4j.Bandwidth[] whisperRateLimit) Custom RateLimit for WhispersMethods inherited from class com.github.twitch4j.common.pool.TwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder
advancedConfiguration, connectionEventManager, eventManager, executor, proxyConfig
Methods inherited from class com.github.twitch4j.common.pool.SubscriptionConnectionPool.SubscriptionConnectionPoolBuilder
disposeUnusedConnections, maxSubscriptionsPerConnection
-
Constructor Details
-
TwitchChatConnectionPoolBuilder
public TwitchChatConnectionPoolBuilder()
-
-
Method Details
-
chatAccount
public B chatAccount(@NonNull @NonNull Supplier<com.github.philippheuer.credentialmanager.domain.OAuth2Credential> chatAccount) Provides a chat account to be used when constructing a newTwitchChat
instance. By default, this yields null, which corresponds to an anonymous connection.- Returns:
this
.
-
automaticallyPartOnBan
Deprecated.use removeChannelOnJoinFailure via advancedConfiguration instead.Whether chat connections should automatically part from channels they have been banned from. This is useful for reclaiming subscription headroom so a minimal number of chat instances are running. By default false so that a chat instance can (eventually) reconnect if a unban occurs.- Returns:
this
.
-
chatRateLimit
Custom RateLimit for ChatMessages- Returns:
this
.
-
whisperRateLimit
Custom RateLimit for Whispers- Returns:
this
.
-
joinRateLimit
Custom RateLimit for JOIN/PART- Returns:
this
.
-
authRateLimit
Custom RateLimit for AUTH- Returns:
this
.
-
perChannelRateLimit
Custom RateLimit for Messages per ChannelFor example, this can restrict messages per channel at 100/30 (for a verified bot that has a global 7500/30 message limit).
- Returns:
this
.
-
connectionBackoffStrategy
WebSocket Connection Backoff Strategy- Returns:
this
.
-
self
- Specified by:
self
in classTwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<TwitchChat,
String, String, Boolean, TwitchChatBuilder, C extends TwitchChatConnectionPool, B extends TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C, B>>
-
build
- Specified by:
build
in classTwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<TwitchChat,
String, String, Boolean, TwitchChatBuilder, C extends TwitchChatConnectionPool, B extends TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C, B>>
-
toString
- Overrides:
toString
in classTwitchModuleConnectionPool.TwitchModuleConnectionPoolBuilder<TwitchChat,
String, String, Boolean, TwitchChatBuilder, C extends TwitchChatConnectionPool, B extends TwitchChatConnectionPool.TwitchChatConnectionPoolBuilder<C, B>>
-