From cd2114aa2374338e7a06e9a5799d2891913ffec5 Mon Sep 17 00:00:00 2001 From: Yumeko Margatroid Date: Sat, 21 Jan 2023 07:06:14 +0000 Subject: [PATCH] Update Twitch IRC. Doesn't look great right now because of the ::null message after. --- TwitchGuide.md | 13 +++++++++++++ src/Client/TwitchIRC.java | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 TwitchGuide.md diff --git a/TwitchGuide.md b/TwitchGuide.md new file mode 100644 index 0000000..1d2e12d --- /dev/null +++ b/TwitchGuide.md @@ -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 `` with your actual client ID: +```https://id.twitch.tv/oauth2/authorize?client_id=&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 `/` diff --git a/src/Client/TwitchIRC.java b/src/Client/TwitchIRC.java index 3bd1ba7..54cc824 100644 --- a/src/Client/TwitchIRC.java +++ b/src/Client/TwitchIRC.java @@ -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; /** @@ -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();