O'Reilly logo

Building Bots with Node.js by Madan Bhintade, Eduardo Freitas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

IRC bots

IRC bot is a program that connects to IRC as one of the clients and appears as one of the users in the IRC channels. These IRC bots are used to provide IRC services or to host chat-based custom implementations that will help teams to efficiently collaborate.

Creating our first IRC bot using IRC and Node.js

Let's start by creating a folder on our local drive, in order to store our bot program, from the Command Prompt:

mkdir ircbot
cd ircbot

Assuming we have Node.js and npm installed, let's create and initialize our package.json, which will store our bot's dependencies and definitions:

npm init

Once you have gone through the npm init options (which are very easy to follow), you'll see something similar to this:

In your project folder, you'll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required