Changeset 64
- Timestamp:
- 02/17/08 18:27:54 (9 months ago)
- Files:
-
- trunk/Phergie/Plugin/Abstract/Command.php (modified) (1 diff)
- trunk/Phergie/Plugin/Url.php (modified) (1 diff)
- trunk/Phergie/phergie.ini (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Abstract/Command.php
r60 r64 51 51 } 52 52 53 preg_match('/^(\S+)(?:\s+(.*))?$/', $message, $match);54 $command = strtolower($match[1]);55 $params = isset ($match[2]) ? $match[2] : array();53 if (preg_match('/^(\S+)(?:\s+(.*))?$/', $message, $match)) { 54 $command = strtolower($match[1]); 55 $params = isset ($match[2]) ? $match[2] : array(); 56 56 57 if (isset ($this->methods[$command])) { 58 $method = 'onDo' . ucfirst($command); 59 if (empty ($params)) { 60 if (!$this->methods[$command]) { 61 $this->$method(); 62 } 63 } else { 64 $params = preg_split('/\s+/', $params, $this->methods[$command]); 65 if ($this->methods[$command] <= count($params)) { 66 call_user_func_array(array($this, $method), $params); 57 if (isset ($this->methods[$command])) { 58 $method = 'onDo' . ucfirst($command); 59 if (empty ($params)) { 60 if (!$this->methods[$command]) { 61 $this->$method(); 62 } 63 } else { 64 $params = preg_split('/\s+/', $params, $this->methods[$command]); 65 if ($this->methods[$command] <= count($params)) { 66 call_user_func_array(array($this, $method), $params); 67 } 67 68 } 68 69 } trunk/Phergie/Plugin/Url.php
r61 r64 84 84 } 85 85 86 if (!isset($title)) { 87 $title = '[ No Title ]'; 88 } 89 86 90 $this->doPrivmsg( 87 91 $this->event->getSource(), trunk/Phergie/phergie.ini
r60 r64 6 6 ; host name of the server to which the bot should connect 7 7 server = 8 9 ; port : 10 ; port on which the bot should connect, defaults to 6667 if none is 11 ; specified; if you don't know what this is for, just leave it blank 12 port = 8 13 9 14 ; username : … … 24 29 ; real name to use for the bot 25 30 realname = 31 32 ; password : 33 ; server password to use when connecting; if you don't know what this is 34 ; for, just leave it blank 35 password = 26 36 27 37 ; gender :