Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stwalkerster/ircclient
C# IRC Client library
https://github.com/stwalkerster/ircclient
Last synced: 1 day ago
JSON representation
C# IRC Client library
- Host: GitHub
- URL: https://github.com/stwalkerster/ircclient
- Owner: stwalkerster
- License: mit
- Created: 2021-05-29T23:57:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-08T22:32:44.000Z (10 days ago)
- Last Synced: 2024-11-08T23:25:51.486Z (10 days ago)
- Language: C#
- Size: 316 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
An IRC Client library
![TeamCity build status](https://teamcity.stwalkerster.co.uk/app/rest/builds/buildType:id:Irc_StwalkersterIrcClient_StwalkersterIrcClient/statusIcon.svg)
## Usage
Configure Microsoft.Extensions.Logging appropriately. For example, using log4net:
```
```
```c#
using Microsoft.Extensions.Logging;
// ...
var loggerFactory = new LoggerFactory().AddLog4Net("log4net.xml");
```Create a configuration object:
```c#
var configuration = new IrcConfiguration(
hostname: "irc.libera.chat",
port: 6697,
authToServices: true,
nickname: "stwtestbot",
username: "stwtestbot",
realName: "stwtestbot",
servicesUsername: "testbot",
servicesPassword: "sup3rs3cr3t",
// OR USE
servicesCertificate: "/path/to/passwordless/store.pfx",
ssl: true,
clientName: "TestClient",
restartOnHeavyLag: false
);
```
Create yourself an IrcClient object, and join a channel:
```c#
var client = new IrcClient(
loggerFactory,
configuration,
new SupportHelper(loggerFactory.CreateLogger)
);client.JoinChannel("##stwalkerster-development");
```Finally, make your new bot do something:
```c#
client.ReceivedMessage += (sender, args) =>
{
if (!args.IsNotice)
{
args.Client.SendMessage("##stwalkerster-development", args.User.ToString() + " -> " + args.Client.Nickname);
}
};client.Mode("##stwalkerster-development", "+t");
```### Various notes:
* If you use servicesCertificate, the client will attempt to do a SASL EXTERNAL authentication. You must enable SSL if you want to use this, as it does mTLS negotiation.