Skip to content

IRC bot for screwing around. Named not for MongoDB, but after Mongo from Blazing Saddles.

Notifications You must be signed in to change notification settings

psaintlaurent/MongoBot

 
 

Repository files navigation

Getting Started
===============

    mkvirtualenv MongoBot
    pip install -r requirements.txt
    
    To run bot: python medulla.py
    To run bot persistently so it will recover from crashes: python doctor.py

    You'll need to install MongoDB to use most of the features relating to people


Dafuq is going on?
==================

    For best results in answering this question, check out settings.py, 
    followed by medulla.py and cortex.py. Also, learn python. 


Advanced Usage
==============

    MongoBot is capable of running a number of web services and apis. For best
    results, run an nginx server and uwsgi server/deploy.ini. And by best results, 
    I mean any. More documentation on this once I figure out how I did it the 
    first time.

    Also, the markov functionality is based on redis, so you'll have to get a 
    redis server up and running.


Secret settings
===============

    You will need to create a file in the root folder called secrets.py.
    sample.secrets.py has descriptions of each setting, just copy it to
    secrets.py and set away.


New features
============

    To create a new command in an existing brainmeat category, add the
    function to the class and add the decorator @axon. To add a help entry
    for the function, add @help("Help message.")

    To create a new command category, run this from the root directory: 
    
    python newbrains.py category_name

    This will create a file called category_name.py in brainmeats, with
    a class Category_name. Loading of this class will be automated, no
    other files need to be altered.


Philosophies
===========

    Don't nest logic when you can short circuit.

    BAD:

    if blah:
        for x in stuff:
            do stuff

    GOOD:

    if not blah:
        return

    for x in stuff:
        do stuff
    
    Try to stick to single quotes wherever possible.

    String interpolation is better than adding up strings. I'm totally 
    not great at remembering this, but I'm trying.

    When using in the chat room, you can pipe commands, i.e.:

    -babble Zaphod | -tweet

    ... will tweet whatever babble spits out.

    If you want a function to be pipeable to other functions, return the output
    instead of just chatting from the function. 
    
    Why would anyone add piping to a chat bot? I dunno. Things got out of hand.

To Do
=====

    + Add autostart for server, if components in place
    + Add an @empty('message if values is empty') decorator
    + Probably make this readme better
    + add tweet at in twitting
    + phase out pageopen for Browse (possibly phaseout requests module)
    + reddit command breaks without specified subreddit
    + Clean up broca, decide what to do with it
    + link holdem to db, make persistant, open up sit/in/out functionality
    + finish holdem, needs testing and split pots probably don't work
    + stock game: account for splits and reverse splits
    + add @requires decorator, check for server, redis, mongo, have -features command to check.
      Function by function level? 

About

IRC bot for screwing around. Named not for MongoDB, but after Mongo from Blazing Saddles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.2%
  • CSS 2.3%
  • JavaScript 1.2%
  • Other 0.3%