Skip to content

Commit

Permalink
Update Twitch IRC. Doesn't look great right now because of the ::null…
Browse files Browse the repository at this point in the history
… message after.
  • Loading branch information
ChildOfDreams authored and lmsv-mx123 committed Aug 20, 2023
1 parent 44f8eca commit cd2114a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions TwitchGuide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Twitch Chat in rsctimes

In order to use Twitch chat in rsctimes, you are required to register an app on Twitch and use it in order to get your OAuth token.

1. Go to [Twitch's developer console](https://dev.twitch.tv/console/apps).
2. Press "Register Your Application".
3. Enter a (unique) name for the application, and set the OAuth redirect URL to `http://localhost:1337`. Also set the Category to `Chat Bot`.
4. Press Manage on your application, and copy your Client ID.
5. Once registered, go to this page in your browser and authorise, replacing `<CLIENTID>` with your actual client ID:
```https://id.twitch.tv/oauth2/authorize?client_id=<CLIENTID>&redirect_uri=http://localhost:1337&response_type=token&scope=chat%3Aread+chat%3Aedit```
6. Once authorised, retrieve your token from the `access_token` part of the web address.
7. In rsctimes Streaming & Privacy settings, enter the channel you want to talk in, your Twitch username (the same one used to authorise the application), and your OAuth token retrieved above.
8. When you log in, you should be able to talk in Twitch chat by prepending your message with `/`
4 changes: 2 additions & 2 deletions src/Client/TwitchIRC.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/** Handles communication with a Twitch chat channel. */
public class TwitchIRC implements Runnable {

public static final String SERVER = "irc.twitch.tv";
public static final String SERVER = "irc.chat.twitch.tv";
public static final int PORT = 6667;

/**
Expand All @@ -55,7 +55,7 @@ public void connect() {
m_writer = new BufferedWriter(new OutputStreamWriter(m_socket.getOutputStream()));
m_reader = new BufferedReader(new InputStreamReader(m_socket.getInputStream()));

m_writer.write("PASS " + Settings.TWITCH_OAUTH.get(Settings.currentProfile) + "\r\n");
m_writer.write("PASS oauth:" + Settings.TWITCH_OAUTH.get(Settings.currentProfile) + "\r\n");
m_writer.write(
"NICK " + Settings.TWITCH_USERNAME.get(Settings.currentProfile).toLowerCase() + "\r\n");
m_writer.flush();
Expand Down

0 comments on commit cd2114a

Please sign in to comment.