Giter VIP home page Giter VIP logo

kribo's Introduction

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

kribo's People

Contributors

krinkle avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar

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.