Changeset 2051 for trunk/modules/kobot/controllers/kobot.php
- Timestamp:
- 02/14/2008 08:30:06 PM (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
r2049 r2051 7 7 // Start a new bot 8 8 $bot = new Kobot('irc.freenode.net'); 9 10 // Add triggers 11 $bot->add_trigger(array($this, 'trigger_say'), '^tell (.+?) about (.+)$') 12 ->add_trigger(array($this, 'trigger_trac'), '^[r|#](\d+)$') 13 ->add_trigger(array($this, 'trigger_php'), '^([a-z_]+)$'); 9 14 10 15 // Enable debugging … … 21 26 } 22 27 28 public function trigger_say(Kobot $bot, array $data, array $params) 29 { 30 switch ($params[1]) 31 { 32 case 'yourself': 33 $bot->send('PRIVMSG '.$data['target'].' :Who wants to know? '.$params[0].'? HA!'); 34 break; 35 } 36 } 37 23 38 } // End
