public function message($type, $destination, $messagearray,
        $priority = SMARTIRC_MEDIUM
    ) {
        if (!is_array($messagearray)) {
            $messagearray = array($messagearray);
        }

        switch ($type) {
            case SMARTIRC_TYPE_CHANNEL:
            case SMARTIRC_TYPE_QUERY:
                foreach ($messagearray as $message) {
                    $this->send('PRIVMSG '.$destination.' :'.$message, $priority);
                }
                break;

            case SMARTIRC_TYPE_ACTION:
                foreach ($messagearray as $message) {
                    $this->send('PRIVMSG '.$destination.' :'.chr(1).'ACTION '
                        .$message.chr(1), $priority
                    );
                }
                break;

            case SMARTIRC_TYPE_NOTICE:
                foreach ($messagearray as $message) {
                    $this->send('NOTICE '.$destination.' :'.$message, $priority);
                }
                break;

            case SMARTIRC_TYPE_CTCP: // backwards compatibility
            case SMARTIRC_TYPE_CTCP_REPLY:
                foreach ($messagearray as $message) {
                    $this->send('NOTICE '.$destination.' :'.chr(1).$message
                        .chr(1), $priority
                    );
                }
                break;

            case SMARTIRC_TYPE_CTCP_REQUEST:
                foreach ($messagearray as $message) {
                    $this->send('PRIVMSG '.$destination.' :'.chr(1).$message
                        .chr(1), $priority
                    );
                }
                break;

            default:
                return false;
        }

        return $this;
    }
public function message($type, $destination, $messagearray,
        $priority = SMARTIRC_MEDIUM
    ) {
        if (!is_array($messagearray)) {
            $messagearray = array($messagearray);
        }

        switch ($type) {
            case SMARTIRC_TYPE_CHANNEL:
            case SMARTIRC_TYPE_QUERY:
                foreach ($messagearray as $message) {
                    $this->send('PRIVMSG '.$destination.' :'.$message, $priority);
                }
                break;

            case SMARTIRC_TYPE_ACTION:
                foreach ($messagearray as $message) {
                    $this->send('PRIVMSG '.$destination.' :'.chr(1).'ACTION '
                        .$message.chr(1), $priority
                    );
                }
                break;

            case SMARTIRC_TYPE_NOTICE:
                foreach ($messagearray as $message) {
                    $this->send('NOTICE '.$destination.' :'.$message, $priority);
                }
                break;

            case SMARTIRC_TYPE_CTCP: // backwards compatibility
            case SMARTIRC_TYPE_CTCP_REPLY:
                foreach ($messagearray as $message) {
                    $this->send('NOTICE '.$destination.' :'.chr(1).$message
                        .chr(1), $priority
                    );
                }
                break;

            case SMARTIRC_TYPE_CTCP_REQUEST:
                foreach ($messagearray as $message) {
                    $this->send('PRIVMSG '.$destination.' :'.chr(1).$message
                        .chr(1), $priority
                    );
                }
                break;

            default:
                return false;
        }

        return $this;
    }
public function message ( $ type , $ destination , $ messagearray , $ priority = SMARTIRC_MEDIUM ) { if ( ! is_array ( $ messagearray ) ) { $ messagearray = array ( $ messagearray ) ; } switch ( $ type ) { case SMARTIRC_TYPE_CHANNEL : case SMARTIRC_TYPE_QUERY : foreach ( $ messagearray as $ message ) { $ this -> send ( 'PRIVMSG ' . $ destination . ' :' . $ message , $ priority ) ; } break ; case SMARTIRC_TYPE_ACTION : foreach ( $ messagearray as $ message ) { $ this -> send ( 'PRIVMSG ' . $ destination . ' :' . chr ( 1 ) . 'ACTION ' . $ message . chr ( 1 ) , $ priority ) ; } break ; case SMARTIRC_TYPE_NOTICE : foreach ( $ messagearray as $ message ) { $ this -> send ( 'NOTICE ' . $ destination . ' :' . $ message , $ priority ) ; } break ; case SMARTIRC_TYPE_CTCP : // backwards compatibility case SMARTIRC_TYPE_CTCP_REPLY : foreach ( $ messagearray as $ message ) { $ this -> send ( 'NOTICE ' . $ destination . ' :' . chr ( 1 ) . $ message . chr ( 1 ) , $ priority ) ; } break ; case SMARTIRC_TYPE_CTCP_REQUEST : foreach ( $ messagearray as $ message ) { $ this -> send ( 'PRIVMSG ' . $ destination . ' :' . chr ( 1 ) . $ message . chr ( 1 ) , $ priority ) ; } break ; default : return false ; } return $ this ; }
sends a new message

Sends a message to a channel or user.

@see DOCUMENTATION
@param integer $type specifies the type, like QUERY/ACTION or CTCP see 'Message Types'
@param string $destination can be a user or channel
@param mixed $messagearray the message
@param integer $priority the priority level of the message
@return boolean|Net_SmartIRC
@api
sends a new message