public function join($channelarray, $key = null, $priority = SMARTIRC_MEDIUM)
    {
        if (!is_array($channelarray)) {
            $channelarray = array($channelarray);
        }

        $channellist = implode(',', $channelarray);

        if ($key !== null) {
            foreach ($channelarray as $idx => $value) {
                $this->send('JOIN '.$value.' '.$key, $priority);
            }
        } else {
            foreach ($channelarray as $idx => $value) {
                $this->send('JOIN '.$value, $priority);
            }
        }

        return $this;
    }