1
0
Fork 0
ImgurIRCBot/bot.php

22 lines
571 B
PHP

<?php
include_once(__DIR__ . '/lib/imgurbot.php');
$conf = json_decode(implode("\n", file(__DIR__ . '/conf/settings.conf')));
$bot = &new ImgurBot($conf);
$irc = &new Net_SmartIRC();
if($conf->debug) $irc->setDebug(SMARTIRC_DEBUG_ALL);
$irc->registerTimehandler(10000, $bot, 'randomTop');
if($conf->ssl) {
$irc->setUseSockets(FALSE);
$irc->connect('ssl://' . $conf->server, $conf->port);
} else {
$irc->setUseSockets(TRUE);
$irc->connect($conf->server, $conf->port);
}
$irc->login($conf->nick, 'ImgurBot', 0, $conf->nick);
$irc->listen();
$irc->disconnect();