Skip to content

Commit cdd8b69

Browse files
committed
Update README
1 parent 4c65bc7 commit cdd8b69

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ In short, this allows you to integrate Twitch Chat to your Unity projects.<br>Th
1414
- Parsing Twitch emotes and badges
1515
- Optional anonymous login
1616
- Automatic ratelimit checks
17+
- Name color normalization (similar to native Twitch chat)
1718

1819
### Unsupported features
1920
- Special messages (whispers, sub/resub, raids, first time viewers, etc)
@@ -39,36 +40,39 @@ https://github.com/lexonegit/Unity-Twitch-Chat.git?path=/Unity-Twitch-Chat/Asset
3940
## Quick start
4041
1. Install the Unity package (see above)
4142
2. Create a new empty GameObject and add the `Twitch IRC` component.
42-
3. In the inspector, set your Twitch authentication details (OAuth, username, channel)
43-
You can generate an OAuth token at https://twitchapps.com/tmi/
44-
OAuth and username are not needed if `Use Anonymous Login` is enabled.
45-
4. Make sure `Connect On Start` is enabled and press play – You should now see JOIN messages, etc. in the console.
46-
5. To start handling chat messages, add a listener to the `IRC.OnChatMessage` event. The listener will receive `Chatter` objects which contain information about the chat message, such as the chatter name, message, emotes, etc...
43+
3. In the inspector, set your Twitch details (OAuth, username, channel)
44+
- You can generate an OAuth token at https://twitchapps.com/tmi/
45+
- Alternatively you can enable `Use Anonymous Login` to use without OAuth
46+
4. Make sure `Connect IRC On Start` and `Join Channel On Start` are enabled and press play – You should now see JOIN messages, etc. in the console.
47+
5. Create a new script that has a listener for the `IRC.OnChatMessage` event.
48+
- See <a href="https://github.com/lexonegit/Unity-Twitch-Chat/blob/main/Unity-Twitch-Chat/Assets/ExampleProject/ListenerExample.cs">ListenerExample.cs</a> for reference.
49+
- The listener will receive `Chatter` objects which contain information about each chat message, such as the chatter name, message, emotes, etc...
4750

4851
<i>Having issues? Check out the included ExampleProject for a better understanding.</i>
4952

5053
## Example project
5154
Spawn chatters as jumping boxes. Box color is based on their primary badge.
55+
5256
<img src="https://user-images.githubusercontent.com/18125997/210427322-27d2231c-5123-4785-997e-53838cfc8972.gif">
5357

5458
## API documentation
5559

5660
### IRC.cs
57-
- **IRC.Connect()** -> Connects to Twitch IRC
58-
- **IRC.Disconnect()** - Disconnects from Twitch IRC
59-
- **IRC.SendChatMessage(string message)** -> Sends a chat message to the channel
60-
- **IRC.JoinChannel(string channel)** -> Join a Twitch channel
61-
- **IRC.LeaveChannel(string channel)** -> Leave a Twitch channel
62-
- **IRC.Ping()** -> Sends a PING message to the Twitch IRC server
63-
- **IRC.OnChatMessage** -> Event that is invoked when a chat message is received
64-
- **IRC.OnConnectionAlert** -> Event that is invoked when a connection alert is received
65-
- **IRC.ClientUserTags** -> The tags (badges, name color, etc) of the client user
61+
- `void` **Connect()** - Connects to Twitch IRC
62+
- `void` **Disconnect()** - Disconnects from Twitch IRC
63+
- `void` **SendChatMessage(string message)** - Sends a chat message to the channel
64+
- `void` **JoinChannel(string channel)** - Join a Twitch channel
65+
- `void` **LeaveChannel(string channel)** - Leave a Twitch channel
66+
- `void` **Ping()** - Sends a PING message to the Twitch IRC server
67+
- `event` **OnChatMessage** - Event that is invoked when a chat message is received
68+
- `event` **OnConnectionAlert** - Event that is invoked when a connection alert is received
69+
- `IRCTags` **ClientUserTags** - Returns the tags of the client user (badges, name color, etc)
6670

6771
### Chatter.cs
68-
- **Chatter.GetNameColor()** -> Returns the color of the chatter's name
69-
- **Chatter.IsDisplayNameFontSafe()** -> Returns true if displayName is "font-safe" meaning that it only contains characters: a-z, A-Z, 0-9, _
70-
- **Chatter.ContainsEmote(string emoteId)** -> Returns true if the chatter's message contains the specified emote (by id)
71-
- **Chatter.HasBadge(string badgeName)** -> Returns true if the chatter has the specified badge
72+
- `Color` **GetNameColor()** - Returns the color of the chatter's name
73+
- `bool` **IsDisplayNameFontSafe()** - Returns true if displayName is "font-safe" meaning that it only contains characters: a-z, A-Z, 0-9, _
74+
- `bool` **ContainsEmote(string emoteId)** - Returns true if the chatter's message contains the specified emote (by id)
75+
- `bool` **HasBadge(string badgeName)** - Returns true if the chatter has the specified badge
7276

7377
## License
7478
<a href="https://github.com/lexonegit/Unity-Twitch-Chat/blob/master/LICENSE">MIT License</a>
@@ -77,4 +81,4 @@ Spawn chatters as jumping boxes. Box color is based on their primary badge.
7781

7882
Intro Fighters, stream overlay game https://lexone.itch.io/introfighters
7983

80-
*Did you make something cool? Contact me (Lexone#3407) to get featured here!*
84+
*Did you make something cool? Contact me (lexone on Discord) to get featured here!*

0 commit comments

Comments
 (0)