Support Center Welcome, Guest Login

Twitch IRC

Last Updated: Jun 24, 2015 03:27PM PDT

Quick Skip to a specific IRC Client
 

Prerequisites

In order to connect to Twitch IRC, you must have two pieces of information:

  1. The name of channel that you want to join.
  2. A Twitch account.
  3. An OAuth token from API or from a site utilizing the API such as TwitchApps
 

Connecting 

Once you have that information, you can then take it to connect to Twitch IRC with the following bits of information:

  • The server name to connect to is: irc.twitch.tv.
  • The port to connect to is 6667 
  • SSL is not supported for Twitch IRC.
  • Your nickname must be your Twitch username / handle
  • Your password should be an OAuth token. You can get your OAuth token here (Thanks Andrew Bashore!)
  • An example "password" using this method would be "oauth:asdasd234asd234ad234asds23" without quotes.
  • This is a "server password" in programs like HexChat.
  • mIRC may require you to enter the password into the GUI.
 

Upon a Successful Connection

Note: Lines prefixed with < are sent from client to server, and lines prefixed with > are sent from the server to the connecting client.

A successful connection session will look something like this:

< PASS oauth:twitch_oauth_token
< NICK twitch_username
> :tmi.twitch.tv 001 twitch_username :connected to TMI
> :tmi.twitch.tv 002 twitch_username :your host is TMI
> :tmi.twitch.tv 003 twitch_username :this server is pretty new
> :tmi.twitch.tv 004 twitch_username tmi.twitch.tv 0.0.1 w n
> :tmi.twitch.tv 375 twitch_username :- tmi.twitch.tv Message of the day - 
> :tmi.twitch.tv 372 twitch_username :- not much to say here
> :tmi.twitch.tv 376 twitch_username :End of /MOTD command

On an Unsuccessful Connection

 

If your connection fails for any reason, you will be disconnected from the server. Some common reasons for being disconnected immediately include:

  • Connecting on the wrong port
  • Connecting to the wrong server
  • Using an incorrect username and/or password (in this case OAuth token)
  • Going over the JOIN or AUTH rate limits.
 

Command, JOIN & Message Limit

 
  • If you send more than 20 commands or messages to the server within a 30 second period, you will get locked out for 8 hours automatically. These are not lifted so please be careful when working with IRC!
  • Mods can type 100 messages in a channel before hitting this rate limit. If a message is sent to a room in which your global message count is already too high, you will be disconnected.
  • JOINs are rate-limited to 50 JOINs per 15 seconds. Additional JOINs sent after this will cause an unsuccessful login.
 

Commands you can send


Most normal chat commands like /timeout, /ban, /clear are sent with periods in place of the forward slash. For example, to ban the user "xangold", you would send ".ban xangold" to the server (minus the quotes). Programs like mIRC will not work with unknown / commands (which is why you use a period.)

Note: Lines prefixed with < are sent from client to server, and lines prefixed with > are sent from the server to the connecting client.

If you send an invalid command, you will receive a 421 numeric back:

< FAKE :multi-prefix
> :tmi.twitch.tv 421 you FAKE :Unknown command

A brief list of commands supported by our IRC server include:

JOIN: Opening a Chat Room & Obtaining a User List

Usage: JOIN #channelname

Notes:
After a successful JOIN, the following will take place:

  1. You will be sent a list of users that are currently in the channel.
  2. A number of MODEs will be set from the jtv user to signify that a user can moderate chat. Users that can moderate chat are are defined as Channel ModeratorsAdmin's and Staff.
< JOIN #channelname
> JOIN #channelname
> 353: = #channelname nickname nickname2 nickname3 nickname4 anotherNickname
> 353: = #channelname nickname25 nickname26 nicknameN
> 366: #channelname End of /NAMES list
> jtv MODE #channelname +o channel_moderator
> jtv MODE #channelname +o channel_moderator2
> jtv MODE #channelname +o staff_user
> jtv MODE #channelname +o twitch_global_mod_user


PART: Leaving a Chat Room

Usage: PART #channelname

< PART #channelname
> PART #channelname

Commands you may receive

PRIVMSG: Someone sent a message to a channel

:nickname!username@nickname.tmi.twitch.tv PRIVMSG #channel :message that was sent

JOINS/PARTS - General

Some IRC clients build user lists using JOIN and PART messages.
You can use IRC v3 requests to turn these on. 
Send a capabilities request for MEMBERSHIP

< CAP REQ :twitch.tv/membership
> :tmi.twitch.tv CAP * ACK :twitch.tv/commands

Other IRC v3 capabilities are documented here.
Each guide includes specific instructions below.

Connecting to Twitch chat with mIRC


1. Install mIRC
2. When program opens, it will automatically open the mIRC options window.
3. Set your nickname in the Connect tree. 

  • Nickname: "your_lowercase_twitch_username_goes_here"
  • Alternative "your_lowercase_twitch_username_goes_here"
4. Click Connect -> Servers 



5. Click "Add"

  • Description: "Twitch Chat"
  • IRC Server: "irc.twitch.tv"
  • Ports: "6667"
  • Group "tmi"
  • Password: OAuth Token: Get from TwitchApps or the API (Example: oauth:2kj34jk4h434jhasdhajs3)
6. Click "Ok / Add"
7. Go back to the "Connect" screen
8. Click the Connect button
9. You can now join channels.
10. You can close the popup asking you to set favorites, or you can add them like this:



To join a channel in mIRC, type /join #xangold, just replace "#xangold" with #channel_name for your own channel. Make sure you type it in lowercase, or it may not work properly!
 

Joins/Parts - mIRC

mIRC Options -> Connection -> Options -> Perform

Check Enable perform on connect, add a network for Twitch if it does not already exist, and then enter the following under Perform commands:

raw CAP REQ :twitch.tv/membership  

 

Connecting to Twitch chat with HexChat


​1. Install HexChat
2. Click "HexChat" on the menu, then click "Network List"
  • Nick name: "your_lowercase_twitch_username_goes_here"
  • Second choice: "your_lowercase_twitch_username_goes_here"
  • Third choice: ""your_lowercase_twitch_username_goes_here"
  • User Name: "your_lowercase_twitch_username_goes_here"
3. Click the "Add button" and name the new network "Twitch"



4. Select your new network, and click "Edit"



5. Click the edit button, and change the network to irc.twitch.tv/6667 from newserver/6667
6. Uncheck the "Use global user information" box. 
7. Fill in your Nickname/second/etc from above. (Note: Do not use your real name)
8. Set the login method to "Server Password /PASS password"
9. Password is an OAuth Token: Get one from TwitchApps or the API (Example: oauth:2kj34jk4h434jhasdhajs3)
10. Click the tab for "Autojoin channels" in the same window.
11. Add channels in the format #user_name_goes_here_all_lowercase



You can also join channels by typing /join #channel_name_goes_here_all_lowercase in the chat bar.
 

Joins/Parts - HexChat

Add the command to the Connect commands tab within the server profile:

 

Connecting to Twitch chat with KVIRC


​1. Install KVIRC
2. Open up KVIRC and navigate to: Settings > Configure Servers



3. ​Select the "New Network" icon in the top right and create a new network, in this case we've named it "Twitch".



4. Next Select "New Server" and enter irc.twitch.tv in the Server field.



5. Next click "Advanced" and enter your Twitch user name in the Nickname field and your OAuth token in the Password field and click OK (You can get an OAuth token from API or from a site utilizing the API such as TwitchApps).



6. Note - You may check "Connect to this server at startup" to join the server automatically when you start KVIRC.



7. Now simply click "Connect Now".


 

Standard IRC context applies here as above. To join a channel simply type /join #channelname in the dialogue box.

KVIRC can be configured to join channels automatically as well. To do this select the Join Channels tab in your Server Details page. Add channels by typing the channel name in the dialogue box and clicking Add (Don’t forget the #hashtag).
 

Joins/Parts - KVIRC

Add the following to the On Connect tab in the server details:

raw CAP REQ :twitch.tv/membership