Code icon indicating copy to clipboard operation
Code copied to clipboard

Code - Python IRC Bot

Code the flexible Python IRC Bot

Code is a open source python IRC bot. Code can run on any operating system that supports Python 2.7, but works best on Linux based distributions.

Feel free to test Code here: https://byteirc.org/channel/%23%2Fdev%2Fnull

Features

Code is packed full of features ranging from raw IRC functions to modules that can be loaded and unloaded with ease. Some features include:

Control panel

Code has a built-in control panel that you can enable, that also serves as a webserver and REST API that allows you to remotely execute functions or retrieve information from the bot via GET/POST requests. Everything is authenticated, too!

The control panel itself:

The control panel

Webserver authentication:

Control panel authentication

Mute feature (also shutdown, reboot, etc):

Control panel muting

Fast & lightweight

Code is very small, so even with the extensive amount of features it has, it should run as little as possible.

Modules

Code uses modules for all of its commands and features. These modules can be loaded, unload, completely removed, and dynamically updated to fit the channels needs. Modules can be made easily, and because of the nature of the modules, you can make whatever you want/control the bot easily.

Very user friendly

It is very easy to install and run Code, even if you have no knowledge of running an IRC bot. I created the bot so it has either no external modules, or the modules are packaged with it. The included 'help' commands provide specific documentation for almost every command. Try .help <command>

Easy to use API

When creating your own modules, it is always very easy to have easy to understand functions and a documented API. Note the API isn't fully documented; there are a lot of features that aren't listed there. See the Wiki for more information.

Open-Source

Found a bug, have an idea for a feature, or need technical support/advice? You can always navigate to the Github page to make requests and post bugs. Heck, even fork Code and make your own modifications!

Configuration

Nearly every single aspect of the bot is configurable for your liking. Don't like a module? Remove it. Like only ONE module? Whitelist it!

Installation - How do I install?

If you have any issues during the install, feel free to head to http://chat.liamstanley.io/ to get help

Unix & Unix-like OS:

apt-get install python2.7 git screen
git clone https://github.com/lrstanley/Code.git
cp -rf example.json config.json
nano config.json
python code.py

If you choose to not run your bot in the foreground, you may use the screen daemon, like so:

screen -S code python code.py

This creates a terminal window that can be logged into and out without disturbing the process in that window. To exit screen safely, hit CTRL+A then CTRL+D. To log back into, and view the playback of Code, type screen -x code.

Windows:

  • Make sure you have Python installed http://www.python.org/download/releases/2.7.5/
  • Download Code here: https://github.com/lrstanley/Code/zipball/master and unzip it.
  • Copy and rename example.json to config.json (Note, it's best NOT to use the Windows notepad, rather, use Notepad++)
  • You can open up command prompt, cd to Codes directory, and execute Code with python code.py.
  • Note, if command prompt says that python is not a internal or external command/program, that means Python failed to be added to your system-wide %PATH% file. So, you need to add it to the %PATH% variable.

Licensing


Code Copyright (C) 2012-2016 Liam Stanley Eiffel Forum License, version 2

1. Permission is hereby granted to use, copy, modify and/or
    distribute this package, provided that:
        * copyright notices are retained unchanged,
        * any distribution of this package, whether modified or not,
          includes this license text.
2. Permission is hereby also granted to distribute binary programs
    which depend on this package. If the binary program depends on a
    modified version of this package, you are encouraged to publicly
    release the modified version of this package.

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.