Book Image

Building Bots with Node.js

By : Eduardo Freitas, Madan Bhintade
Book Image

Building Bots with Node.js

By: Eduardo Freitas, Madan Bhintade

Overview of this book

<p>The bots are taking over and we're all for it! Messenger-based bots will be the dominant software UI for the next generation of applications – even Slack, Telegram, and Facebook are driving a new approach where "threads are the new apps."</p> <p>This book shows you how to create work automation bots that interact with users through Slack, e-mail, Skype, Twitter, and more using Node.js. You'll learn to create conversational UIs for your Node.js apps, and then use those UIs to provide workflow automation tools.</p> <p>You will be shown how to handle customer service requests that come in through messenger systems – this includes interpreting the natural language to reveal the user's intent and respond accordingly. You will also learn how to automate processes that involve several people, such as processing holiday requests, arranging meetings, or sending updated reports on time.</p> <p>By the end of this book you'll have the knowledge to create bots that can handle and manipulate documents, URLs, and other items of content. Harness the power of bots and your organization will reap the benefits.</p>
Table of Contents (16 chapters)
Building Bots with Node.js
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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 see the result, which is your package.json file:

Let's install the irc package from npm. This can be located at https://www.npmjs.com/package/irc .

In order to install it, run this npm command.

npm install --save irc

You should then see something...