https://github.com/ghostzero/twitchmessenger
Twitch Messenger Java API (inofficial)
https://github.com/ghostzero/twitchmessenger
api chatbot discontinued twitchtv
Last synced: 7 months ago
JSON representation
Twitch Messenger Java API (inofficial)
- Host: GitHub
- URL: https://github.com/ghostzero/twitchmessenger
- Owner: ghostzero
- License: mit
- Created: 2017-08-27T21:53:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-26T09:32:27.000Z (over 7 years ago)
- Last Synced: 2025-01-24T10:47:34.836Z (9 months ago)
- Topics: api, chatbot, discontinued, twitchtv
- Language: Java
- Size: 143 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://ghostzero.me/discord)
# Twitch Messenger API
## Setup
### Enable Debug Console
Push `F12` in your Twitch App (opens debug mode) and press `F5` to reload your client then navigate to your network tab.
### Get UserID, MachineKey & SessionId

### Get AuthToken
Parse the Auth Token from the Cookie: ...; CourseAuthToken=`AuthToken` and decode with https://urldecode.org/

### Get ClientId

## Example
```java
TwitchMessenger messenger = new TwitchMessenger(
"userId",
"clientId",
"authToken",
"machineKey",
"sessionId"
);messenger.setListener(new TwitchMessengerListener() {
public void onMessage(TwitchConversation conversation, String message) {
System.out.println("Message: " + message);
}
});messenger.connect();
// My example server: https://app.twitch.tv/servers/Mb3k7A
TwitchServer server = messenger.getServer("7b0d11d5-717a-4311-9f68-355897b10628");
TwitchConversation conversation = server.getConversation("201647be-8be5-4b99-bac9-b7266ba561f6");conversation.sendMessage("Hello World!");
Scanner s = new Scanner(System.in);
while (s.hasNext()) {
String line = s.nextLine();
if(line.equals("exit") || line.equals("end")) {
System.exit(0);
} else {
conversation.sendMessage(line);
}
}
```