IRC client library targetting .NET Standard 2.0. Built off of the work done in fredimachado/NetIRC.
- Up-to-date builds on NuGet
- More complete coverage of IRC message types
- Improved documentation
See the main documentation here
dotnet add package GravyIrc
public async void TestClient() {
var user = new User(config.Nick, config.Identity);
var client = new IrcClient(user, new TcpClientConnection());
client.EventHub.Subscribe<RplWelcomeMessage>(Client_OnRegistered);
client.EventHub.Subscribe<PrivateMessage>((client, args) => Console.WriteLine(args.IrcMessage.Message));
await client.ConnectAsync(config.Server, config.Port);
}
private async void Client_OnRegistered(object sender, EventArgs e) {
if (!string.IsNullOrEmpty(config.NickServ)) {
await client.SendAsync(new PrivMsgMessage("NickServ", $"identify {config.NickServ}"));
}
await client.SendAsync(new ModeMessage(config.Nick, "+B"));
await JoinDefaultChannels();
}