PHP code example of unionofrad / li3_bot

1. Go to this page and download the library: Download unionofrad/li3_bot library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

unionofrad / li3_bot example snippets


Connections::add('default', array(
	'type' => 'database',
	'adapter' => 'MySql',
	// ...
));

Libraries::add('li3_bot', array(
	'host' => 'irc.freenode.net',
	'port' => 6667,
	'nick' => 'li3bot',
	'channels' => ['#li3', '#li3-core'],
	'rewriters' => [
		'(example\.(org|com))' => function($inner, $outer) {
			return str_replace($inner, '<strike>' . $inner . '</strike>', $outer);
		},
		'(.*)' => function($inner, $outer) {
			return '<a href="' . $inner . '" rel="nofollow">' . $outer . '</a>';
		}
	]
));