GithubHelp home page GithubHelp logo

isabella232 / node-irc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from botriot/node-irc

0.0 0.0 0.0 201 KB

NodeJS IRC client library

License: GNU General Public License v3.0

JavaScript 86.13% Python 13.87%

node-irc's Introduction

node-irc is an IRC client library written in JavaScript for Node.

You can access more detailed documentation for this module at Read the Docs

Installation

The easiest way to get it is via npm:

npm install irc

If you want to run the latest version (i.e. later than the version available via npm) you can clone this repo, then use npm to link-install it:

npm link /path/to/your/clone

Of course, you can just clone this, and manually point at the library itself, but I really recommend using npm!

Basic Usage

This library provides basic IRC client functionality. In the simplest case you can connect to an IRC server like so:

var irc = require('irc');
var client = new irc.Client('irc.dollyfish.net.nz', 'myNick', {
channels: ['#blah'],
});

Of course it's not much use once it's connected if that's all you have!

The client emits a large number of events that correlate to things you'd normally see in your favourite IRC client. Most likely the first one you'll want to use is:

client.addListener('message', function (from, to, message) {
console.log(from + ' => ' + to + ': ' + message);
});

or if you're only interested in messages to the bot itself:

client.addListener('pm', function (from, message) {
console.log(from + ' => ME: ' + message);
});

or to a particular channel:

client.addListener('message#yourchannel', function (from, message) {
console.log(from + ' => #yourchannel: ' + message);
});

At the moment there are functions for joining:

client.join('#yourchannel yourpass');

parting:

client.part('#yourchannel');

talking:

client.say('#yourchannel', "I'm a bot!");
client.say('nonbeliever', "SRSLY, I AM!");

and many others. Check out the API documentation for a complete reference.

For any commands that there aren't methods for you can use the send() method which sends raw messages to the server:

client.send('MODE', '#yourchannel', '+o', 'yournick');

Further documentation (including a complete API reference) are available in reStructuredText format in the docs/ folder of this project, or online at Read the Docs.

If you find any issues with the documentation (or the module) please send a pull request or file an issue and I'll do my best to accommodate.

node-irc's People

Contributors

martynsmith avatar jakobwesthoff avatar mortal avatar wraithan avatar esamattis avatar eirikb avatar jonrohan avatar fent avatar schwuk avatar joeshaw avatar rsms avatar stigi avatar alexwhitman avatar oshuma avatar excedrin avatar lloyd avatar akavlie avatar luscoma avatar alexmingoia avatar hello71 avatar chilts avatar avianflu avatar tapichu avatar evl avatar haxd avatar thejh avatar jaswope avatar justinabrahms avatar mape avatar mdwrigh2 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.