Changeset 2055 for trunk/modules/kobot/controllers/kobot.php
- Timestamp:
- 02/15/2008 08:53:29 AM (11 months ago)
- Files:
-
- 1 modified
-
trunk/modules/kobot/controllers/kobot.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/kobot/controllers/kobot.php
r2052 r2055 12 12 13 13 // Add triggers 14 $bot->add_trigger('^goodnight, bot$', array($this, 'trigger_quit')) 15 ->add_trigger('^tell (.+?) about (.+)$', array($this, 'trigger_say')) 16 ->add_trigger('^([r|#])(\d+)$', array($this, 'trigger_trac')) 17 ->add_trigger('^[a-z_]+$', array($this, 'trigger_default')); 14 $bot->set_trigger('^goodnight, bot$', array($this, 'trigger_quit')) 15 ->set_trigger('^tell (.+?) about (.+)$', array($this, 'trigger_say')) 16 ->set_trigger('^([r|#])(\d+)$', array($this, 'trigger_trac')) 17 ->set_trigger('^[a-z_]+$', array($this, 'trigger_default')); 18 19 // Add timers 20 $bot->set_timer(5, array($this, 'say_hi')); 18 21 19 22 // Login and join the default channel 20 23 $bot->login('koboto'); 21 24 $bot->join('#koboto'); 25 $bot->read(); 26 } 22 27 23 $bot->read(); 28 public function say_hi(Kobot $bot) 29 { 30 // Say hello! 31 $bot->log(1, 'Just saying a timed hello!'); 24 32 25 // $bot->send('PRIVMSG #koboto :Go away, Shadowhand!');26 // $bot->quit('hahahaha');33 // Only execute the timer once 34 $bot->remove_timer(array($this, __FUNCTION__)); 27 35 } 28 36 … … 55 63 { 56 64 case '#': 57 $bot->send('PRIVMSG '.$data['target'].' :Ticket #'.$params[2].' ishttp://trac.kohanaphp.com/ticket/'.$params[2]);65 $bot->send('PRIVMSG '.$data['target'].' :Ticket '.$params[2].', http://trac.kohanaphp.com/ticket/'.$params[2]); 58 66 break; 59 67 case 'r': 60 $bot->send('PRIVMSG '.$data['target'].' :Revision r'.$params[2].' ishttp://trac.kohanaphp.com/changeset/'.$params[2]);68 $bot->send('PRIVMSG '.$data['target'].' :Revision '.$params[2].', http://trac.kohanaphp.com/changeset/'.$params[2]); 61 69 break; 62 70 }
