Coder Social home page Coder Social logo

glubot's Introduction

glubot

irc bot for glugnith channel

So I found this npm module node-irc and started tweaking with it.

You need to understand the structure of the bot. The two main part of this bot is

  • observers
  • commands

Observers

The observers looks into the all the communication which takes place in the channel. If they detect certain keyword they reply accordingly. For example :

16:46 <@sagark> Hello sir can I ask you something

16:46 < glubot> Hey sagark please don't use sir to address people. Use nicks instead.

16:46 < glubot> Modified: Hello can I ask you something

See the bot filter result when someone user Sir or Ma'am on the irc. The observer file doing this is here.

Commands

The other thing the bot can do is follow your commands. All the commands are in the command folder. Right now it supports the following commands :

  • !weather <city_name> - tells the weather of your city
  • !bark - bark at you :D
  • !wp - fetches wikipedia starting paragraph (Need Rework)
  • !define - find the meaning of the word
  • !score - fetches cricket matches score
  • !help - lists all commands
  • !ping - standard ping - pong command
  • !quote - displays a random quote

So all commands goes into the commands folder. And all the observers goes into the observer folder. If you are new to this you can start start contributing by making your own command like a joke command, or fetch some news etc.

How to run this locally ?

  • Clone the project
  • Run npm install to download all the packages.
  • Change the irc channel name in the config.js file in config folder.
  • Run node app.js

glubot's People

Contributors

rahul-raturi avatar sagarkarira avatar

Watchers

 avatar  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.