GithubHelp home page GithubHelp logo

ind3p3nd3nt / ircclient Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fredimachado/ircclient

0.0 1.0 0.0 70 KB

Simple cross-platform console IRC Client written in C++

License: GNU Lesser General Public License v3.0

C++ 98.70% Makefile 1.30%

ircclient's Introduction

Simple cross-platform Console IRC Client

Windows Linux Azure (Linux/macOS)
Windows Build status Linux Build Status Azure Build Status (Linux/macOS)
  • It works on windows and linux (haven't tested on mac)
  • 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

Hooking IRC commands:

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

Building on windows with Mingw:

  • Edit Makefile
  • Replace "-lpthread" with "-lws2_32" (no quotes) in LDFLAGS on line 3.
  • Add ".exe" extension (no quotes) to the EXECUTABLE filename (line 8).

Contribution

Just send a pull request! :)

GNU LGPL

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.

http://www.gnu.org/licenses/lgpl.html

ircclient's People

Contributors

fredimachado avatar ind3p3nd3nt avatar fire avatar wipe2238 avatar kuntau avatar tarferi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.