Skip to content

Simple cross-platform IRC Client Library written in C# targeting .NET Standard 2.0

License

Notifications You must be signed in to change notification settings

halomakes/GravyIrc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GravyIrc Logo

GravyIrc

Build Status GitHub issues Nuget Nuget

IRC client library targetting .NET Standard 2.0. Built off of the work done in fredimachado/NetIRC.

Goals

  • Up-to-date builds on NuGet
  • More complete coverage of IRC message types
  • Improved documentation

See the main documentation here

Quick Start

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();
}