GithubHelp home page GithubHelp logo

dbot's Introduction

DBot IRC Bot

Introduction

DBot is an IRC bot which aims to be the fanciest IRC bot around - On the general standard of software fanciness, dbot is statistically rated as being '82% the same as bathing in fine, fine grape juice.'

Please note that this documentation is not complete and is a work in progress, given I started it rather a long time after I began development of the project. Please don't judge me too harshly for this as I am, in fact, mildly allergic to writing documentation.

Getting Started

To get started with DBot, you first need to decide on a database system to use. DBot uses the databank library, and each module can be configured to use any database driver databank supports in its respective config.json file. There is currently no default database driver option.

The default for all modules is the 'redis' driver, and you can simply install the Redis server to get going.

Once you have that set up, you can install DBot's dependencies, configure and run the bot for the first time with the following command:

./install

Upgrading

If you have used a previous version of DBot, then you can migrate most data using the dbot-migrate module. Instructions on how to run this are included in the repository - remember to remove db.json after migration, otherwise the instance will be slow!

dbot's People

Contributors

alexanderpbrown avatar amki avatar borntyping avatar dafrancis avatar danhedron avatar eddiecurtis avatar iiinsanitea avatar johnmaguire avatar kabniel avatar moggers87 avatar n3hima-mothball avatar odyckhoff avatar powerjungle avatar probutcher avatar psquid avatar rctrapdoor avatar reality avatar samstudio8 avatar scritches avatar shymega avatar somehibs avatar talizea avatar thependulum avatar tmenari avatar welshmullet avatar zuzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbot's Issues

Database Backup

depressionbot should back up the database to a file defined in its configuration

~alias

Upon ~alias command show if given nick is a primary user

Disconnect Hook

Detect connection loss and reconnect dbot to the necessary servers.

Modularize web.js

Modules should be able to provide the web module views to display, rather than being explicitly defined in web.js itself.

Investigate License

depressionbot should probably be made available under some license if people are to develop modules for it.

Ability to set alias as primary nick

Description

The users module for tracking known users and their aliases isn't fool-proof; in certain situations the database will incorrectly record an alias as the primary nick, and the user's primary nick as an alias. This may happen if:

  • A user joins for the first time and they are assigned a username, but they later pick a real username (msn -> Sam).
  • Dbot begins recording during Christmas while everybody is using stupid bloody Christmas nicknames (reality -> realitree).
  • A user decides to permanently change their nickname (Pyro -> ijz).

These cases are difficult to tackle programmatically, and therefore we need a command to change the database so that a nick which is currently stored as an alias of a user is switched around such that the alias is now the primary nick, and the primary nick is now an alias.

How

This will be achieved with a command called something like ~setaliasparent [alias] [primary].

Before:

{
    "users": [
        "msn"
    ],
    "aliases": {
        "Sam": "msn",
        "Christsam": "msn"
        "Fireman": "msn"
    }
}

After:

{
    "users": [
        "Sam"
    ],
    "aliases": {
        "msn": "Sam",
        "Christsam": "Sam"
        "Fireman": "Sam"
    }
}
Considerations

In terms of the known users module itself, after this it should function fine. In the above example, msn will now be an alias of Sam, and all previous aliases of msn will now be aliases of Sam.

The considerations here come in where we're looking at modules that are using information from this known users database. For example, stats; userStats uses the primary username as a key and before recording any information in the database it will look up the event.user in the aliases database to see if it links to any primary users.

Previously, while Sam was an alias of msn, the userStats entry for him will have been stored with the key 'msn,' as that was the primary nick. When Sam changes to the primary nick and msn changes to an alias of Sam, it will create a new userStats key under Sam.

I think we can get around this with a maintenance function in stats which checks if there are any keys in userStats that are keys in 'aliases' instead of being in the 'users' array? Could we check for this in the particular case of msn/Sam when the next listener is triggered?

Thoughts?

~mergeusers

So currently we have the situation that a person may cause a disconnect in the known users database by doing things like leaving with one nick and joining with another, so we end up with a situation in which there are several main users and each of these may have their own set of aliases.

{
    "users": [ "Sam", "FiremanSam" ],
    "aliases": {
        "FiremanSam|brbfire": "FiremanSam",
        "ElSamuelo": "Sam",
        "Sam|FuckTheGroupProject": "Sam"
    }
}

The case here being that both users Sam, FiremanSam and all of their aliases belong to just Sam. This is a situation which requires another manual fixing command which will transform the above data structure into the following:

{
    "users": [ "Sam" ]
    "aliases": {
        "FiremanSam": "Sam",
        "FiremanSam|brbfire": "Sam",
        "ElSamuelo": "Sam",
        "Sam|FuckTheGroupProject": "Sam"
    }
}

To do this we need a command with the format: ~mergeuser primary_user secondary_user which will do the following:

  1. Remove secondary_user from users.
  2. Add an entry for secondary_user in aliases, linking to primary_user.
  3. Change all aliases which refer to secondary_user to refer to primary_user.

Module Documentation

Now each module has its own directory, we can add a README.md for each which can serve as official documentation.

Statistics Module

To achieve his quest for webscalability, depressionbot will need the power of statistics.

Consolidate puns and quotes

Now that listeners can listen on multiple actions, we should consolidate the puns module with the quotes module.

Web chat interface

Create a module which allows people to chat in an IRC room from the depressionbot web interface.

A ~help command

Once #75 is complete, we can add a standard config.json key such as 'help_link.' Then we can create a ~help command which either:

  • Takes the name of a module as a parameter and links to its help page.
  • Takes the name of a command as a parameter, figures out which module it belongs to and links to its help page.

Generate Documentation

Write a script that can generate a module's README file from source because writing documentation is annoying.

Admin flag on commands

Allow a command to be marked as for admin use only, as opposed to having to check whether event.user is in the dbot.admins list.

Change spam protection model for quotes

  • Retain 5 second timeout for ~rm and ~rmlast
  • Otherwise allow ~rm and ~rmlast unlimited
  • Remove from quotes, but add removals to sessionData.removeCache
  • Automatically delete removeCache on a timer which is reset every time ~rm or ~rmlast is run
  • If removeCache gets too big, remove timer and warn admin that removeCache is too big and require confirmation of removal

Known Users

@reality Create jsbot event handler for NICK with event. oldUser and event.newUser

Admin ignore command

Add an admin command to force depressionbot to ignore a user for all modules (useful when preventing the gathering of user and channel statistics from other bots, for example).

Internal API for modules

Add 'api' property to modules, loaded by DBot into dbot.api.modulename to provide functions which other modules can use. This means that we can provide data abstraction and minimise modules which do not own db data from operating directly upon it. Also code reduction, cohesion, all that.

Needed for great good and for #86 and relevant to #85

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.