A declarative framework for developing Twitch chat bots in C# 🤖
TwitchIRC is a pre-alpha framework built in C#, for interacting with the Twitch API. With a strong focus on DX and ease-of-use, TwitchIRC is declarative and modular, with an optional commands framework inspired by other chat bot frameworks.
using TwitchIRC;
using TwitchIRC.Types;
IRCClient client = new IRCClientBuilder()
.WithAccessToken(...)
.WithUsername(...)
.Build();
client.OnReady += () => client.Send("JOIN #channel");
client.OnChatMessage += (IRCChatMessage msg) => Console.WriteLine(msg.Content);
client.Run();
- Parses IRC messages.
- Authenticates using
PASS
andNICK
with Twitch. - Responds to keep-alives.
- Handles event callbacks for
OnReady
,OnMessage
andOnChatMessage
. - Implemented a declarative command framework using reflection.
- Incorporated proper unit testing using xUnit and FluentAssertions.
- Handle socket disconnects, reconnect requests, etc.
- Receive Twitch-specific commands and other IRC capabilities.
- Support the Twitch IRC tags for extra metadata, such as badges, emotes, etc.
- Implemented additional events for
OnUserJoin
andOnUserPart
of a given channel. - Add custom types for users, channels, etc, rather than just using a
string
. - Extend the IRC client for use with other parts of the Twitch API, to send whispers, handle alerts, etc.