This repository has been archived by the owner. It is now read-only.
[Discontinued] PHP-framework for creating simple IRC bots. https://packagist.org/search/?q=irc
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
archive
includes
plugins
.gitignore
.travis.yml
HOOKS.md
Init.php
LocalConfig.sample.php
README.md
composer.json

README.md

Build Status

Krinkle

Krinkle IRC Bot

Introduction

Kribo is a small PHP-framework for creating simple IRC bots. By default it has little function but its power is in the extensibility through plugins.

Be it custom functionality of the bot (executing commands to a server), or simple commands like "!date", or to log a transcript of the channels, you can do it with Kribo.

Requirements

  • PHP: 5.3.2+
  • Shell access to your server
  • Server permission: PHP may not be in safe mode and socket connections must be allowed from your account and from PHP.

Installation

  1. Configure Kribo in LocalConfig.php
  2. Start the bot with:
    php Init.php

Configuration

One can have per-instance local and shared configuration (e.g. nickname, target channel(s), activated plugins and more).

The configuration is stored in the global $KriboConfig object and is populated through ./includes/DefaultConfig.php. Settings can be overriden or extended through ./LocalConfig.php and by plugins installed through ./LocalConfig.php.

Server

  • serverHost: Hostname of the IRC server to connect to (e.g. "localhost" or "irc.freenode.net")
  • serverPort: Port to connect to on serverHost. The default (6667) should be fine in most cases
  • socketHostname: The IP-address to bind the socket to. Not currently used.
  • autoJoinChannels: Channels joined on start-up.

User

  • userChatName: Default username that the bot will use to identify itself when connecting to serverHost.
  • userAltNamePattern: What to use if the nickname is already taken or may not be used. You can use $1 as dynamic substitute for userChatName. So if userChatName = "MyBot"; and userAltNamePattern = "$1_";, then it will use "MyBot_" if "MyBot" is taken.
  • userRealName: The value to use as "real name" in the IRC user information. $1 will be replaced with value of version.

Authentication

If all of the next four are not null, then the bot will PRIVMSG userAuthService directly after the connection is established (before channels are joined), with the userAuthPattern. The default settings are optimized for the "NickServ" service as found on many servers (such as Freenode). If you're using that, then only userAuthID and userAuthPassword have to be set in ./LocalConfig.php.

  • userAuthService: Nickname of the authservice available on serverHost
  • userAuthPattern: Pattern of the message that is to be send to userAuthServer to identify. $1 will be replaced with userAuthID, and $2 with userAuthPassword.
  • userAuthID: Auth username
  • userAuthPassword: Auth password. Be careful when publishing your LocalConfig that this isn't exposed!

Command info

  • commandPrefixDefault: The default listener for commands. Individual commands may override this.
  • $1: userChatName
  • $2: userAuthID
  • $3: current nickname.
  • Example values:
    "!" (!foo)
    "$1: " (KriboNick: foo)
    "$2: " (Kribo: foo)
    "$3 " (KriboNick__ foo)
  • commandResponseDefault: One of KRIBO_CMD_RE_DEFAULT, KRIBO_CMD_RE_CHANNEL, KRIBO_CMD_RE_CHANNEL_AT, KRIBO_CMD_RE_PRIVATE, KRIBO_CMD_RE_PRIVATE_AT, KRIBO_CMD_RE_IGNORE.

Command registry

  • commandRegistry: This keeps track of all commands. Keys are the command names. Values are arrays with options. Check HOOKS for more info.

Hooks

  • hookRegistry: Registry for hooks. For example:
$KriboConfig->hookRegistry['hookname'][] = 'myclass::func';

$KriboMain->unregisterHookFunc( 'myclass::func', 'hookname' );

$KriboConfig->hookRegistry['onReceive'][] = 'KriboCoreHooks::onReceive';

Plugins

Check out https://github.com/Krinkle/Kribo-plugins

FAQ

  1. Where can I download Kribo?
    Get started right away with a git clone:
    git clone https://github.com/Krinkle/Kribo.git
    Or download the latest master as a ZIP from: https://github.com/Krinkle/Kribo/zipball/master

  2. How do I install Kribo?
    Check Installation.

  3. Where can I get plugins?
    I mainain a small stock at https://github.com/Krinkle/Kribo-plugins

  4. Where should I report X or request Y?
    If you encounter any problem, have feedback, suggestions, patches, feature requests etc. please enter in the Issue tracker: https://github.com/Krinkle/Kribo/issues

  5. Under what license is Kribo available?
    Creative Commons Attribution 3.0 Unported