Klasse TwitchChatBuilder
Documentation: https://dev.twitch.tv/docs/irc
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected BandwidthCustom RateLimit for AUTHprotected Collection<String> User IDs of Bot Owners for applyingCommandPermission.OWNERprotected IntegerSize of the ChatQueueprotected BandwidthCustom RateLimit for ChatMessagesIRC Command Handlersprotected BucketShared bucket for authsprotected BucketShared bucket for joinsprotected BucketShared bucket for messagesprotected BucketVeraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitprotected BandwidthCustom RateLimit for JOIN/PARTprotected BandwidthCustom RateLimit for Messages per Channelprotected Bandwidth[]Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimit -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbuild()Twitch API Client (Helix)static TwitchChatBuilderbuilder()Initialize the builderCustom RateLimit for AUTHA custom websocket url forTwitchChatto connect to.User IDs of Bot Owners for applyingCommandPermission.OWNERIRC User IdlongThe amount of milliseconds to wait after queuing a JOIN before classifying the attempt as a failure.Size of the ChatQueuelongMillisecond wait time for taking items off chat queue.Custom RateLimit for ChatMessagesClient IdClient SecretIRC Command HandlersWebSocket Connection Backoff StrategyCredential ManagerClass<? extends com.github.philippheuer.events4j.api.service.IEventHandler> EventManagerEvent ManagerShared bucket for authsShared bucket for joinsShared bucket for messagesVeraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitCustom RateLimit for JOIN/PARTintThe maximum number of retries to make for joining each channel, with exponential backoff.Custom RateLimit for Messages per ChannelProxy ConfigurationHTTP Request Queue SizeScheduler Thread Pool ExecutorWebsocketConnectionVeraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitintWebsocket Close Delay in ms (0 = minimum)intWebSocket RFC Ping Period in ms (0 = disabled)booleanWhether one's own channel should automatically be joinedbooleanWhether JOIN/PART events should be enabled for theTwitchChatinstance.booleanWhether join failures should result in removal from current channels.booleanWhether theOAuth2Credentialpassword should be sent when the baseUrl does not match the official twitch websocket server, thus bypassing a security check in the library.booleanWhether thegetChatAccount()should be validated on reconnection failures.setBotOwnerIds(Collection<String> botOwnerIds) User IDs of Bot Owners for applyingCommandPermission.OWNERsetCommandPrefixes(Set<String> commandPrefixes) IRC Command HandlerswithAuthRateLimit(Bandwidth authRateLimit) Custom RateLimit for AUTHwithAutoJoinOwnChannel(boolean autoJoinOwnChannel) Whether one's own channel should automatically be joinedwithBaseUrl(String baseUrl) A custom websocket url forTwitchChatto connect to.withBotOwnerId(String userId) With a Bot Owner's User IDwithBotOwnerIds(Collection<String> botOwnerIds) With multiple Bot Owner User IDswithChatAccount(OAuth2Credential chatAccount) IRC User IdwithChatJoinTimeout(long chatJoinTimeout) The amount of milliseconds to wait after queuing a JOIN before classifying the attempt as a failure.withChatQueueSize(Integer chatQueueSize) Size of the ChatQueuewithChatQueueTimeout(long chatQueueTimeout) Millisecond wait time for taking items off chat queue.withChatRateLimit(Bandwidth chatRateLimit) Custom RateLimit for ChatMessageswithClientId(String clientId) Client IdwithClientSecret(String clientSecret) Client SecretwithCommandTrigger(String commandTrigger) With a CommandTriggerwithCommandTriggers(Collection<String> commandTrigger) With multiple CommandTriggerswithConnectionBackoffStrategy(IBackoffStrategy connectionBackoffStrategy) WebSocket Connection Backoff StrategywithCredentialManager(CredentialManager credentialManager) Credential ManagerwithDefaultEventHandler(Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> defaultEventHandler) EventManagerwithEnableMembershipEvents(boolean enableMembershipEvents) Whether JOIN/PART events should be enabled for theTwitchChatinstance.withEventManager(EventManager eventManager) Event ManagerwithIrcAuthBucket(Bucket ircAuthBucket) Shared bucket for authswithIrcJoinBucket(Bucket ircJoinBucket) Shared bucket for joinswithIrcMessageBucket(Bucket ircMessageBucket) Shared bucket for messageswithIrcWhisperBucket(Bucket ircWhisperBucket) Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitwithJoinRateLimit(Bandwidth joinRateLimit) Custom RateLimit for JOIN/PARTwithMaxJoinRetries(int maxJoinRetries) The maximum number of retries to make for joining each channel, with exponential backoff.withOutboundCommandFilter(BiPredicate<TwitchChat, String> outboundCommandFilter) Veraltet.withPerChannelRateLimit(Bandwidth perChannelRateLimit) Custom RateLimit for Messages per ChannelwithProxyConfig(ProxyConfig proxyConfig) Proxy ConfigurationwithRemoveChannelOnJoinFailure(boolean removeChannelOnJoinFailure) Whether join failures should result in removal from current channels.withRequestQueueSize(Integer requestQueueSize) HTTP Request Queue SizewithScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor) Scheduler Thread Pool ExecutorwithSendCredentialToThirdPartyHost(boolean sendCredentialToThirdPartyHost) Whether theOAuth2Credentialpassword should be sent when the baseUrl does not match the official twitch websocket server, thus bypassing a security check in the library.withVerifyChatAccountOnReconnect(boolean verifyChatAccountOnReconnect) Whether thegetChatAccount()should be validated on reconnection failures.protected TwitchChatBuilderwithWebsocketConnection(WebsocketConnection websocketConnection) WebsocketConnectionwithWhisperRateLimit(Bandwidth[] whisperRateLimit) Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitwithWsCloseDelay(int wsCloseDelay) Websocket Close Delay in ms (0 = minimum)withWsPingPeriod(int wsPingPeriod) WebSocket RFC Ping Period in ms (0 = disabled)
-
Felddetails
-
botOwnerIds
User IDs of Bot Owners for applyingCommandPermission.OWNER -
commandPrefixes
IRC Command Handlers -
chatQueueSize
Size of the ChatQueue -
chatRateLimit
Custom RateLimit for ChatMessages -
whisperRateLimit
Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitCustom RateLimit for Whispers -
joinRateLimit
Custom RateLimit for JOIN/PART -
authRateLimit
Custom RateLimit for AUTH -
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).
-
ircMessageBucket
Shared bucket for messages -
ircWhisperBucket
Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitShared bucket for whispers -
ircJoinBucket
Shared bucket for joins -
ircAuthBucket
Shared bucket for auths
-
-
Methodendetails
-
builder
Initialize the builder- Gibt zurück:
- Twitch Chat Builder
-
build
Twitch API Client (Helix)- Gibt zurück:
- TwitchHelix
-
withCommandTrigger
With a CommandTrigger- Parameter:
commandTrigger- Command Trigger (Prefix)- Gibt zurück:
- TwitchChatBuilder
-
withCommandTriggers
With multiple CommandTriggers- Parameter:
commandTrigger- Command Trigger (Prefix)- Gibt zurück:
- TwitchChatBuilder
-
withBotOwnerId
With a Bot Owner's User ID- Parameter:
userId- the user id- Gibt zurück:
- TwitchChatBuilder
-
withBotOwnerIds
With multiple Bot Owner User IDs- Parameter:
botOwnerIds- the user ids- Gibt zurück:
- TwitchChatBuilder
-
getWebsocketConnection
WebsocketConnectioncan be used to inject a mocked connection into the TwitchChat instance
-
getClientId
Client Id -
getClientSecret
Client Secret -
getRequestQueueSize
HTTP Request Queue Size -
getEventManager
Event Manager -
getDefaultEventHandler
public Class<? extends com.github.philippheuer.events4j.api.service.IEventHandler> getDefaultEventHandler()EventManager -
getCredentialManager
Credential Manager -
getChatAccount
IRC User Id -
getBaseUrl
A custom websocket url forTwitchChatto connect to. Must include the scheme (e.g. ws:// or wss://). -
isSendCredentialToThirdPartyHost
public boolean isSendCredentialToThirdPartyHost()Whether theOAuth2Credentialpassword should be sent when the baseUrl does not match the official twitch websocket server, thus bypassing a security check in the library.Do not depart from the default false value unless you understand the consequences.
-
getBotOwnerIds
User IDs of Bot Owners for applyingCommandPermission.OWNER -
getCommandPrefixes
IRC Command Handlers -
getChatQueueSize
Size of the ChatQueue -
getChatRateLimit
Custom RateLimit for ChatMessages -
getWhisperRateLimit
Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitCustom RateLimit for Whispers -
getJoinRateLimit
Custom RateLimit for JOIN/PART -
getAuthRateLimit
Custom RateLimit for AUTH -
getPerChannelRateLimit
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).
-
getIrcMessageBucket
Shared bucket for messages -
getIrcWhisperBucket
Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitShared bucket for whispers -
getIrcJoinBucket
Shared bucket for joins -
getIrcAuthBucket
Shared bucket for auths -
getScheduledThreadPoolExecutor
Scheduler Thread Pool Executor -
getChatQueueTimeout
public long getChatQueueTimeout()Millisecond wait time for taking items off chat queue. Default recommended -
getProxyConfig
Proxy Configuration -
isAutoJoinOwnChannel
public boolean isAutoJoinOwnChannel()Whether one's own channel should automatically be joined -
isEnableMembershipEvents
public boolean isEnableMembershipEvents()Whether JOIN/PART events should be enabled for theTwitchChatinstance. -
isRemoveChannelOnJoinFailure
public boolean isRemoveChannelOnJoinFailure()Whether join failures should result in removal from current channels.- Siehe auch:
-
getMaxJoinRetries
public int getMaxJoinRetries()The maximum number of retries to make for joining each channel, with exponential backoff. Set to zero or a negative value to disable this feature. -
getChatJoinTimeout
public long getChatJoinTimeout()The amount of milliseconds to wait after queuing a JOIN before classifying the attempt as a failure.If this value is configured too low, the chat instance could mistake a successfully joined channel for a failure. This can be especially problematic when removeChannelOnJoinFailure has been set to true.
-
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
WebSocket Connection Backoff Strategy -
isVerifyChatAccountOnReconnect
public boolean isVerifyChatAccountOnReconnect()Whether thegetChatAccount()should be validated on reconnection failures.If enabled and the token has expired, chat will connect in read-only mode instead.
If the network connection is too slow, you may want to disable this setting to avoid disconnects while waiting for the result of the validate endpoint.
-
withWebsocketConnection
WebsocketConnectioncan 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
thisif an identical value is passed).
-
withClientId
Client Id- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withClientSecret
Client Secret- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withRequestQueueSize
HTTP Request Queue Size- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEventManager
Event Manager- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDefaultEventHandler
public TwitchChatBuilder 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
thisif an identical value is passed).
-
withCredentialManager
Credential Manager- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatAccount
IRC User Id- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withBaseUrl
A custom websocket url forTwitchChatto connect to. Must include the scheme (e.g. ws:// or wss://).- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withSendCredentialToThirdPartyHost
Whether theOAuth2Credentialpassword should be sent when the baseUrl does not match the official twitch websocket server, thus bypassing a security check in the library.Do not depart from the default false value unless you understand the consequences.
- Gibt zurück:
- 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- Gibt zurück:
this.
-
setCommandPrefixes
IRC Command Handlers- Gibt zurück:
this.
-
withChatQueueSize
Size of the ChatQueue- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatRateLimit
Custom RateLimit for ChatMessages- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withWhisperRateLimit
Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitCustom RateLimit for Whispers- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withJoinRateLimit
Custom RateLimit for JOIN/PART- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withAuthRateLimit
Custom RateLimit for AUTH- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withPerChannelRateLimit
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).
- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withIrcMessageBucket
Shared bucket for messages- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withIrcWhisperBucket
Veraltet.Twitch will decommission whispers over IRC on February 18, 2023; please migrate to TwitchHelix#sendWhisper and TwitchLimitRegistry#setLimitShared bucket for whispers- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withIrcJoinBucket
Shared bucket for joins- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withIrcAuthBucket
Shared bucket for auths- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withScheduledThreadPoolExecutor
public TwitchChatBuilder withScheduledThreadPoolExecutor(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor) Scheduler Thread Pool Executor- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatQueueTimeout
Millisecond wait time for taking items off chat queue. Default recommended- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withProxyConfig
Proxy Configuration- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withAutoJoinOwnChannel
Whether one's own channel should automatically be joined- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEnableMembershipEvents
Whether JOIN/PART events should be enabled for theTwitchChatinstance.- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withRemoveChannelOnJoinFailure
Whether join failures should result in removal from current channels.- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed). - Siehe auch:
-
withMaxJoinRetries
The maximum number of retries to make for joining each channel, with exponential backoff. Set to zero or a negative value to disable this feature.- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withChatJoinTimeout
The amount of milliseconds to wait after queuing a JOIN before classifying the attempt as a failure.If this value is configured too low, the chat instance could mistake a successfully joined channel for a failure. This can be especially problematic when removeChannelOnJoinFailure has been set to true.
- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withWsPingPeriod
WebSocket RFC Ping Period in ms (0 = disabled)- Gibt zurück:
- 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)- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed). - Siehe auch:
-
withConnectionBackoffStrategy
WebSocket Connection Backoff Strategy- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withVerifyChatAccountOnReconnect
Whether thegetChatAccount()should be validated on reconnection failures.If enabled and the token has expired, chat will connect in read-only mode instead.
If the network connection is too slow, you may want to disable this setting to avoid disconnects while waiting for the result of the validate endpoint.
- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withOutboundCommandFilter
@Deprecated @Internal public TwitchChatBuilder withOutboundCommandFilter(BiPredicate<TwitchChat, String> outboundCommandFilter) Veraltet.Filter for outbound messages. The command will not be sent to the IRC server if the predicate yields true.Only intended for internal use by twitch4j.
- Gibt zurück:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-