Hello There, Guest!
View New Posts  |  View Today's Posts
[JavaScript] Simple IRC Bot

  • 0 Vote(s) - 0 Average


12-12-2014, 06:10 PM #1
Louis
Master of the IRCs!
**
Posts: 153 Threads:23 Joined: May 2012 Reputation: 11

[JavaScript] Simple IRC Bot
So I run a JavaScript IRC bot that people ask me about often. I've decided to write a (very) simple lib so others can do the same. It's available on GitHub at https://github.com/LouisT/SimpleIRCBot.

Using it is pretty simple, you after you download the source (and have Node.js installed), you can create a simple bots with a few lines of code. The actual bot lib is in "/libs/bot.js", "index.js" is an example of a parrot bot and more are available in "/examples/". Here is an example of how to just greet people:

Code:
var Bot = require('./libs/bot')(require('./config').irc).connect();

Bot.on('001',function () { // Bot connected.
    this.join(conf.irc.channels);
});

Bot.on('433',function () { // Nick in use.
    this.nick('Simple????');
});

Bot.on('join',function (user,chan) { // The bot or another user has joined a channel.
    if (user[1] != this.irc.botnick) {
       this.say(chan,'Hello, $c04$b'+user[1]+'$c$b! This is just a dumb bot.');
    };
});


Side note: Why is there no specific area for JavaScript awesomeness, KoBe!?

12-15-2014, 09:33 AM #2
AZERTY9
Junior Member
**
Posts: 1 Threads:0 Joined: Dec 2014 Reputation: 0

RE: [JavaScript] Simple IRC Bot
thx bro for shar
many thx




Forum Jump:


Possibly Related Threads...
Thread Author Replies Views Last Post
  [JavaScript/Node.js] Upside down text generator. Louis 3 2,652 10-01-2014, 09:06 PM
Last Post: AceInfinity
  [JavaScript/Node.js] Video Information Louis 5 4,753 03-31-2013, 11:30 PM
Last Post: Louis
  Node.js: JavaScript on the Server Presentation AceInfinity 0 1,420 02-03-2013, 01:35 AM
Last Post: AceInfinity
  Video Tutorial - Create a simple MyBB Plugin KoBE 3 16,354 12-22-2012, 01:39 PM
Last Post: Epixors
  MyBB Today's Posts Javascript Bookmarklet AceInfinity 10 6,107 10-05-2012, 12:35 AM
Last Post: AceInfinity


Users browsing this thread: 1 Guest(s)