c# irc library
Go to file
2024-06-13 13:15:58 -04:00
.idea/.idea.ChatSharp/.idea add IDE settings 2022-04-12 16:16:05 -04:00
ChatSharp ConnectAsync returns Task 2024-06-13 13:15:58 -04:00
ChatSharpTests add some more tests 2024-04-19 18:13:54 -04:00
Example ConnectAsync returns Task 2024-06-13 13:15:58 -04:00
.gitattributes Normalize line endings 2015-08-24 19:00:44 -03:00
.gitignore Add support for unusual channel prefixes 2015-05-09 14:39:51 -06:00
ChatSharp.sln .net 6, tidy up some warnings 2022-04-12 16:14:48 -04:00
ChatSharp.sln.DotSettings add IDE settings 2022-04-12 16:16:05 -04:00
ChatSharp.sln.DotSettings.user netstandard and revert target type new 2024-04-19 00:24:48 -04:00
LICENSE Initial commit 2013-04-09 15:19:48 -06:00
README.md update build instructions 2024-04-19 17:42:57 -04:00

ChatSharp

A C# library for chatting on an IRC (Internet Relay Protocol) network.

Supports a lot of RFC 1459 and a little of 2812.

Example Usage

var client = new IrcClient("irc.libera.chat", new IrcUser("ChatSharp", "ChatSharp"));

client.ConnectionComplete += (s, e) => client.JoinChannel("#botwar");

client.ChannelMessageReceived += (s, e) =>
{
    var channel = client.Channels[e.PrivateMessage.Source];

    if (e.PrivateMessage.Message == ".list")
        channel.SendMessage(string.Join(", ", channel.Users.Select(u => u.Nick)));
    else if (e.PrivateMessage.Message.StartsWith(".ban "))
    {
        if (!channel.UsersByMode['@'].Contains(client.User))
        {
            channel.SendMessage("I'm not an op here!");
            return;
        }
        var target = e.PrivateMessage.Message.Substring(5);
        client.WhoIs(target, whois => channel.ChangeMode("+b *!*@" + whois.User.Hostname));
    }
};

client.ConnectAsync();

while (true) ; // Waste CPU cycles

Compiling

dotnet build -c Release

You'll receive binaries in ChatSharp/bin/Release/netstandard2.1. ChatSharp has no dependencies.

Support

Open an issue describing your problem.

Development / Contributing

ChatSharp is developed with the following workflow:

  1. Nothing happens for weeks/months/years
  2. Someone needs it to do something it doesn't already do
  3. That person implements that something and submits a pull request
  4. Repeat

If it doesn't have a feature that you want it to have, add it! The code isn't that scary.