Building an IRC Bot with Cinch

Bot Tech

© Lead Image © Chris Modarelli, 123RF.com

© Lead Image © Chris Modarelli, 123RF.com

Article from Issue 160/2014
Author(s):

Chat rooms aren't just for people. We'll show you how to access an IRC channel using an automated bot.

IRC, the Internet Relay Chat has existed for 20 years, and it is still a popular communication channel in open source projects and businesses. For almost as long, automated bots have listened on IRC channels and responded to user commands. The article shows how IRC bots can make themselves useful by helping you manage tickets and prepare documentation.

Spoiled for Choice

To develop an IRC bot today, you no longer need to learn Tcl to activate the bot ancestor Eggdrop [1]. Frameworks for bots are available in virtually any language (Table 1). Although I focus here on Cinch [2], a framework written in Ruby under the MIT license (Figure 1), you can easily adapt the code examples presented in this article to other languages.

Cinch comes with an object-oriented API and a modular plugin system. Thanks to many unrelated plugins, a single bot can perform all kinds of tasks. To an IRC server, Cinch – as is typical of IRC bots – appears as a normal client. Therefore, it does not matter which system the bot runs on, whether on the same system as the IRC server or remotely on a developer machine. Nor does it matter which server software you use, as long as the server is a compliant implementation of IRC.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • GLPI

    Anyone working in information technology knows how hard it is to keep track of inventory, maintenance history, and user support requests. GLPI puts the details in reach.

  • Trouble Ticket Software

    If your help line serves outside users, keeping track of support requests can mean the difference between a repeat customer and a lost customer. If the line serves inside employees, an efficient response means better productivity. Fortunately,several Linux-based applications offer help for your help desk or hotline.

  • Crystal

    Crystal is an open source project that seeks to combine the best of two worlds: the simplicity of a language syntax similar to Ruby and the speed and capabilities of the LLVM platform.

  • Workspace – Fossil SCM

    Get started with Fossil, a beginner-friendly software configuration management system that includes everything you need to work on your next great software project.

  • Command Line: Vim Plugins

    Managing plugins is a requirement for Vim users, and plugin managers can make the task easier. We look at four options.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News