public function registerTriggers($triggers, $channel)
    {
        if (!is_array($triggers)) {
            $triggers = array($triggers);
        }

        $fmt        = $this->getFormatter(false);
        $translator = $fmt->getTranslator();
        if (!is_string($channel)) {
            throw new \Erebot\InvalidValueException($fmt->_('Invalid channel'));
        }

        $scopes = array(
            $channel => $translator->_(
                'A trigger named "<var name="trigger"/>" '.
                'has already been registered on channel <var name="chan"/>.'
            ),
            self::MATCH_ANY => $translator->_(
                'A trigger named "<var name="trigger"/>" '.
                'has already been registered globally.'
            ),
        );

        foreach ($triggers as $trigger) {
            foreach ($scopes as $scope => $error) {
                if (isset($this->triggers[$scope])) {
                    if ($this->containsRecursive($this->triggers[$scope], $trigger)) {
                        $this->logger and $this->logger->info(
                            $fmt->render(
                                $error,
                                array(
                                    'trigger' => $trigger,
                                    'chan' => $channel,
                                )
                            )
                        );
                        return null;
                    }
                }
            }
        }

        $this->triggers[$channel][] = $triggers;
        end($this->triggers[$channel]);
        return $channel.' '.key($this->triggers[$channel]);
    }