GithubHelp home page GithubHelp logo

derpbot's Introduction

DerpBot

DerpBot is a multi-purpose IRC bot.

Dependencies:

  • Maven (For building from sources)
  • JDK8 (For building from sources, JRE8 enough for just running the built JAR)

Building

Execute

mvn clean package

"Installation"

  • Create directory /opt/derpbot/ and place the built JAR file as /opt/derpbot/DerpBot.jar
  • Create a configuration file as /opt/derpbot/derpbot.properties (see derpbot.properties.example for reference)
  • Create a (system)user for DerpBot:
useradd -s /bin/false -r -M -d /opt/derpbot derpbot
  • The initscript contains a sysvinit initscript, copy it as /etc/init.d/derpbot and execute
update-rc.d derpbot defaults

Note: DerpBot will look for derpbot.properties configuration file in the directory where the JAR file itself is, and one directory above that. This means, during development, you can have your local derpbot.properties file in the "root" of the project and execute the JAR directly from the Maven target directory.

Running

For "installed" version:

service derpbot start

For built version (while in the "root" of the project):

java -jar target/DerpBot.jar

Easily compile and run while developing:

mvn compile exec:java

Developing additional features

The basic concept of creating a new feature is to create a new class under fi.derpnet.derpbot.handler.impl and implement one of the following interfaces (which ever suits your needs best), and add the class to HandlerRegistry. (This could be replaced with some sort of dynamic scanning of the classpath for compatible interfaces...)

  • RawMessageHandler - handles any RAW message that comes from the IRC server
  • SimpleMessageHandler - handles regular PRIVMSG messages (both on channels and in queries and sends a one-message response
  • SimpleMultiLineMessageHandler - same as above but is capable of sending multiple lines of response
  • LoudMessageHandler - handles regular PRIVMSG messages (both on channels and in queries and sends a one-message response to the sender if the original message was sent to a quieter channel
  • LoudMultiLineMessageHandler - same as above but is capable of sending multiple lines of response

Package conventions:

  • fi.derpnet.derpbot.adapter - contains adapter classes (mainly for handler adapters)
  • fi.derpnet.derpbot.bean - contains bean-like classes
  • fi.derpnet.derpbot.util - contains utility classes
  • fi.derpnet.derpbot.handler - contains the handler-specific interfaces
  • fi.derpnet.derpbot.handler.impl - contains the actual handler implementations

derpbot's People

Contributors

kalleeen avatar scrin avatar

Watchers

Juho Vanhanen 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.