enanobot.php
changeset 40 1855846cbdab
parent 38 e6a4b7f91e91
child 41 1d854f22ac5a
equal deleted inserted replaced
39:4027a5b47db5 40:1855846cbdab
    74 require('libirc.php');
    74 require('libirc.php');
    75 require('hooks.php');
    75 require('hooks.php');
    76 require('config.php');
    76 require('config.php');
    77 require('database.php');
    77 require('database.php');
    78 
    78 
       
    79 $enanobot_version = '0.5-unstable';
       
    80 
    79 @ini_set('display_errors', 'on');
    81 @ini_set('display_errors', 'on');
    80 error_reporting(E_ALL);
    82 error_reporting(E_ALL);
    81 
    83 
    82 // load modules
    84 // load modules
    83 foreach ( $modules as $module )
    85 foreach ( $modules as $module )
   180     $GLOBALS['_shutdown'] = true;
   182     $GLOBALS['_shutdown'] = true;
   181     $quitmessage = empty($match[1]) ? "Remote bot shutdown ordered by {$message['nick']}" : $match[1];
   183     $quitmessage = empty($match[1]) ? "Remote bot shutdown ordered by {$message['nick']}" : $match[1];
   182     $irc->close($quitmessage, true);
   184     $irc->close($quitmessage, true);
   183     return 'BREAK';
   185     return 'BREAK';
   184   }
   186   }
       
   187   else if ( in_array($message['nick'], $privileged_list) && preg_match('/^re(?:hash|load)?(?:config)?(?: |$)/', $message['message']) )
       
   188   {
       
   189     require('config.php');
       
   190     $GLOBALS['privileged_list'] = $privileged_list;
       
   191     $GLOBALS['alert_list'] = $alert_list;
       
   192     $irc->privmsg($message['nick'], "Reloaded privileged_list and alert_list. privileged = " . str_replace("\n", '', print_r($privileged_list, true)) . "; alert = " . str_replace("\n", '', print_r($alert_list, true)));
       
   193   }
       
   194   else if ( substr($message['message'], 0, 1) == "\x01" && substr($message['message'], -1) == "\x01" )
       
   195   {
       
   196     $msg = trim($message['message'], "\x01");
       
   197     list($ctcp) = explode(' ', $msg);
       
   198     $params = substr($msg, strlen($ctcp)+1);
       
   199     eval(eb_fetch_hook('event_ctcp'));
       
   200   }
   185   else if ( $message['action'] == 'PRIVMSG' )
   201   else if ( $message['action'] == 'PRIVMSG' )
   186   {
   202   {
   187     eval(eb_fetch_hook('event_privmsg'));
   203     eval(eb_fetch_hook('event_privmsg'));
   188   }
   204   }
   189   else
   205   else