API - Messaging Interface
The Twitch Chat System has a few unofficial endpoints which get exposed from https://tmi.twitch.tv
.
danger
Twitch has decommissioned all of these endpoints. Please migrate to the official Helix API.
As Module: Twitch4J
To use TMI you need to enable the TMI API when building the Twitch4J Instance, as shown below:
- Java
- Kotlin
- Groovy
TwitchClient twitchClient = TwitchClientBuilder.builder()
...
.withEnableTMI(true)
...
.build();
val twitchClient = TwitchClientBuilder.builder()
...
.withEnableTMI(true)
...
.build()
def twitchClient = TwitchClientBuilder.builder()
...
.withEnableTMI(true)
...
.build()
Standalone
Initialize the Helix API as Standalone Module:
- Java
- Kotlin
- Groovy
TwitchMessagingInterface client = TwitchMessagingInterfaceBuilder.builder()
.withClientId("clientId")
.withClientSecret("clientSecret")
.build();
val client = TwitchMessagingInterfaceBuilder.builder()
.withClientId("clientId")
.withClientSecret("clientSecret")
.build()
def client = TwitchMessagingInterfaceBuilder.builder()
.withClientId("clientId")
.withClientSecret("clientSecret")
.build()