- It works on Windows, Linux, and macOS
- Can be used as an IRC bot
- It has a simple hook system where you can do whatever you want when receiving an IRC command.
- Example in Main.cpp
First create a function (name it whatever you want) with two arguments, an IRCMessage and a pointer to IRCClient:
void onPrivMsg(IRCMessage message, IRCClient* client)
{
// Check who can "control" us
if (message.prefix.nick != "YourNick")
return;
// received text
std::string text = message.parameters.at(message.parameters.size() - 1);
if (text == "join #channel")
client->SendIRC("JOIN #channel");
if (text == "leave #channel")
client->SendIRC("PART #channel");
if (text == "quit now")
client->SendIRC("QUIT");
}Then, after you create the IRCClient instance, you can hook it:
IRCClient client;
// Hook PRIVMSG
client.HookIRCCommand("PRIVMSG", &onPrivMsg);CMake 3.20 or newer and a C++20 compiler. From the repository root:
cmake --preset default && cmake --build --preset default && ctest --preset defaultThe executable is ircclient on Unix and ircclient.exe on Windows:
ircclient host port [nick] [user] [password]nick defaults to MyIRCClient, user defaults to IRCClient, and password is sent only when you pass it.
These presets need Ninja. Do not combine them.
AddressSanitizer and UndefinedBehaviorSanitizer:
cmake --preset linux-sanitizer && cmake --build --preset linux-sanitizer && ctest --preset linux-sanitizerCoverage instrumentation for src/ (CI compares gcovr line and branch percentages against cmake/coverage-baseline.json):
cmake --preset linux-coverage && cmake --build --preset linux-coverage && ctest --preset linux-coverageJust send a pull request! :)
IRCClient is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.