Krinkle IRC Bot
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.
- 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.
- Configure Kribo in
LocalConfig.php
- Start the bot with:
php Init.php
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
.
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 casessocketHostname
: The IP-address to bind the socket to. Not currently used.autoJoinChannels
: Channels joined on start-up.
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 foruserChatName
. So ifuserChatName = "MyBot";
anduserAltNamePattern = "$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.
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 serverHostuserAuthPattern
: 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 usernameuserAuthPassword
: Auth password. Be careful when publishing your LocalConfig that this isn't exposed!
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 ofKRIBO_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
.
commandRegistry
: This keeps track of all commands. Keys are the command names. Values are arrays with options. Check HOOKS for more info.
hookRegistry
: Registry for hooks. For example:
$KriboConfig->hookRegistry['hookname'][] = 'myclass::func';
$KriboMain->unregisterHookFunc( 'myclass::func', 'hookname' );
$KriboConfig->hookRegistry['onReceive'][] = 'KriboCoreHooks::onReceive';
Check out https://github.com/Krinkle/Kribo-plugins
-
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 -
How do I install Kribo?
Check Installation. -
Where can I get plugins?
I mainain a small stock at https://github.com/Krinkle/Kribo-plugins -
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 -
Under what license is Kribo available?
Creative Commons Attribution 3.0 Unported