Ganon11 / WorfBot2

An extensible (via commands) IRC Bot written in Python
GNU General Public License v3.0
0 stars 2 forks source link

THIS BOT IS DEPRECATED IN FAVOR OF WORFBOT3

IRC Bot

A simple IRC Bot written in Python To start it just cd to the src directory and type ./ircbot.py, although before using the bot it's recommended to check the config first.

The bot can handle multiple channels at a time, also if you want to have a private discussion it can be queried (/query WorfBot).

IRC Protocol reference: [RFC 1459](http://www.irchelp.org/irchelp/rfc/rfc.html "IRC Protocol")

Documentation

Sphinx docs to come

Commands

Total: 13 commands

Auto-commands

Total: 3 auto-commands

Adding commands

  1. In src/config.py you must add the name of the command to the cmds_list's end(without !)
  2. In src/cmds/ directory you must create a file named after your command
  3. Into the newly created file you must define a function named after your command that takes one parameter. This parameter will contain the command components sent by the user. The function must return either a message (string) to be sent on the channel, or a list, first item being a command (other than PRIVMSG which is added automatically if needed) and the second being the command's arguments.

E.g.:

If you want to create a command !ncmd, you must follow these steps:

  1. Add 'ncmd' to the cmds_list in src/config.py
  2. Create src/cmds/ncmd.py
  3. In src/cmds/ncmd.py define def dance(param):, param will hold the users command components(see src/parser.py) in case you must do some checkings, it must return a message(eg. return 'Dance time!', in this case src/ircbot.py will automatically add PRIVMSG at the beginning and \r\n at the end) or a list(eg. return ['JOIN ', '#chan1,#chan2'], in this case the list will be joined and \r\n added at the end)

If you want to create a command that the bot should execute if something happens on the chat (not if the command is manually triggered) you should add the command name to the auto_cmds_list insead of cmds_list.

Config

See src/config.py:

Dependencies

License

(C) Copyright 2011-2014 Barbu Paul - Gheorghe

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.