Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.73 KB

README.md

File metadata and controls

36 lines (29 loc) · 1.73 KB

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