Handle the main "pong" command

@param \Phergie\Irc\Plugin\React\Command\CommandEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
973639
public function handleCommand(Event $event, Queue $queue)
    {
        $queue->ircPrivmsg($event->getSource(), $this->getResponse($event));
    }
675398
public function handleJoinCommand(CommandEvent $event, EventQueueInterface $queue)
    {
        $params = $event->getCustomParams();
        if (!$params) {
            $this->handleJoinHelp($event, $queue);
        } else {
            $channels = $params[0];
            $keys = isset($params[1]) ? $params[1] : null;
            $queue->ircJoin($channels, $keys);
        }
    }
639308
public function onCommandAfterPrepare(Event $event) {

        $command = $event['command'];
        $bucket = $command['Bucket'];
        $request = $command->getRequest();
        if ($command->getName() == 'ListBuckets')
        {
            if ($this->ipport != null) {
                $request->setHost($this->ipport);
                $request->setHeader('Host', 'service.cos.myqcloud.com');
            } else if ($this->endpoint != null) {
                $request->setHost($this->endpoint);
                $request->setHeader('Host', 'service.cos.myqcloud.com');
            }
            else {

                $request->setHost('service.cos.myqcloud.com');
            }
            return ;
        }
        if ($key = $command['Key']) {
            // Modify the command Key to account for the {/Key*} explosion into an array
            if (is_array($key)) {
                $command['Key'] = $key = implode('/', $key);
            }
        }
        $request->setHeader('Date', gmdate('D, d M Y H:i:s T'));
        $request->setPath(preg_replace("#^/{$bucket}#", '', $request->getPath()));

        if ($this->appId != null && endWith($bucket,'-'.$this->appId) == False)
        {
            $bucket = $bucket.'-'.$this->appId;
        }
//        $request->setPath(urldecode($request->getPath()));
        $request->getParams()->set('bucket', $bucket)->set('key', $key);

        $realHost = $bucket. '.' . $request->getHost();
        if($this->ipport != null) {
            $request->setHost($this->ipport);
            $request->setHeader('Host', $realHost);
        } else {
            if($this->endpoint != null) {
                $tmp = $bucket. '.' . $this->endpoint;
                $request->setHost($tmp);
            } else {
                $request->setHost($realHost);
            }
        }
        if (!$bucket) {
            $request->getParams()->set('cos.resource', '/');
        } else {
            // Bucket style needs a trailing slash
            $request->getParams()->set(
                'cos.resource',
                '/' . rawurlencode($bucket) . ($key ? ('/' . Client::encodeKey($key)) : '/')
            );
        }
    }
630362
public function handleCommand(CommandEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $server = strtolower($event->getConnection()->getServerHostname());
        $source = $event->getSource();
        $nick = $event->getNick();
        if ($source === null || $nick === null || $source == $nick) {
            $logger->debug('Command request not in channel, ignoring');
            return;
        }

        $params = $event->getCustomParams();
        if (empty($params)) {
            $this->handleCommandHelp($event, $queue);
            return;
        }

        $target = $params[0];
        try {
            $data = $this->db->fetchAssoc(
               'SELECT "time", "nick", "type", "text"
                FROM "seen"
                WHERE "server" = :server
                AND "channel" = :channel
                AND (
                    "nick" = :nick
                    OR (
                        "type" = ' . self::TYPE_NICK . '
                        AND "text" = :nick
                    )
                )
                ORDER BY "time" DESC
                LIMIT 1',
                array(
                    ':server' => $server,
                    ':channel' => $source,
                    ':nick' => $target,
                )
            );
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
            $queue->ircPrivmsg($source, "\x02Error:\x02 Could not retrieve data.");
            return;
        }

        if ($data === false) {
            $queue->ircPrivmsg($source, "I haven't seen \x02$target\x02 in $source!");
            return;
        }

        switch ($data['type']) {
            case (self::TYPE_JOIN):
                $message = 'joining the channel.';
                break;

            case (self::TYPE_PART):
                if ($data['text']) {
                    $message = "leaving the channel ({$data['text']})";
                }
                else {
                    $message = 'leaving the channel.';
                }
                break;

            case (self::TYPE_KICK):
                if ($data['text']) {
                    $message = "being kicked from the channel ({$data['text']})";
                }
                else {
                    $message = 'being kicked from the channel.';
                }
                break;

            case (self::TYPE_QUIT):
                if ($data['text']) {
                    $message = "disconnecting from IRC ({$data['text']})";
                }
                else {
                    $message = 'disconnecting from IRC.';
                }
                break;

            case (self::TYPE_PRIVMSG):
                $message = "saying: {$data['text']}";
                break;

            case (self::TYPE_NOTICE):
                $message = "sending a notice: {$data['text']}";
                break;

            case (self::TYPE_ACTION):
                $message = "saying: * {$data['nick']} {$data['text']}";
                break;

            case (self::TYPE_NICK):
                if (!strcasecmp($target, $data['nick'])) {
                    $target = $data['nick'];
                    $message = "changing nick to {$data['text']}.";
                }
                else {
                    $target = $data['text'];
                    $message = "changing nick from {$data['nick']}.";
                }
                break;

            default:
                $logger->error('Unknown parameter type retrieved from database', $data);
                $queue->ircPrivmsg($source, "\x02Error:\x02 A database error occurred.");
                return;
        }

        // Canonicalise capitalisation
        if ($data['type'] != self::TYPE_NICK) {
            $target = $data['nick'];
        }

        if ($this->isInChannel($server, $source, $target))
        {
            $prefix = "\x02$target\x02 is currently in the channel! Last seen";
        } else {
            $prefix = "\x02$target\x02 was last seen";
        }

        $queue->ircPrivmsg($source, "$prefix " . $this->ago($data['time']) . " $message");
    }
416552
protected function sendHelpReply(Event $event, Queue $queue, array $messages)
    {
        $method = 'irc' . $event->getCommand();
        $target = $event->getSource();
        foreach ($messages as $message) {
            $queue->$method($target, $message);
        }
    }
476204
public function handleQuit(UserEvent $event, Queue $queue)
    {
        $nick = $event->getNick();
        if ($this->primaryNick !== null && $nick == $this->primaryNick) {
            $this->logger->debug("[AltNick] '$nick' disconnected, switching to primary nick");
            $queue->ircNick($this->primaryNick);
            $this->primaryNick = null;
        }
    }
945613
public function handleEvent(Event $event, Queue $queue)
    {
        $iterator = $this->getIterator($event->getConnection());

        if (!$iterator->valid()) {
            $queue->ircQuit('All specified alternate nicks are in use');
            return;
        }

        if ($this->recovery && $this->primaryNick === null) {
            $params = $event->getParams();
            $primaryNick = $params[1];
            $this->logger->debug("[AltNick] Saving '$primaryNick' as primary nick");
            $this->primaryNick = $primaryNick;
        }

        $nick = $iterator->current();
        $iterator->next();

        $this->logger->debug("[AltNick] Switching nick to '$nick'");
        $queue->ircNick($nick);
    }
93501
def queue_command(self, command):
        
        if self._running:
            # queue event normally
            QtCore.QCoreApplication.postEvent(
                self, ActionEvent(command), QtCore.Qt.LowEventPriority)
        else:
            # save event until we are started
            self._incoming.append(command)
482165
public function handleGhost(ServerEvent $event, Queue $queue)
    {
        if ($this->ghostNick === null) {
            return;
        }

        // Attempt to kill the ghost connection
        $queue->ircPrivmsg($this->botNick, 'GHOST ' . $this->ghostNick . ' ' . $this->password);
    }
154099
public function handleBigstockHelp(Event $event, Queue $queue)
    {
        $messages = [
            'Usage: bigstock queryString',
            'queryString - the search query (all words are assumed to be part of message)',
            'Searches Bigstock for an image based on the provided query string.',
        ];
        foreach ($messages as $message) {
            $queue->ircPrivmsg($event->getSource(), $message);
        }
    }
1232751
final public function handle(Command $command): void
    {
        if (!$command instanceof ReceivedCommand && $this->discriminator->shouldEnqueue($command)) {
            $this->queue->send($command);

            return;
        }

        if ($command instanceof ReceivedCommand) {
            $command = $command->getOriginalCommand();
        }

        $this->wrappedCommandBus->handle($command);
    }
1163467
protected function commandStartingHandler(CommandStarting $event)
    {
        if ($event->command) {
            Integration::configureScope(function (Scope $scope) use ($event): void {
                $scope->setTag('command', $event->command);
            });

            Integration::addBreadcrumb(new Breadcrumb(
                Breadcrumb::LEVEL_INFO,
                Breadcrumb::TYPE_USER,
                'artisan.command',
                'Invoked Artisan command: ' . $event->command,
                method_exists($event->input, '__toString') ? [
                    'input' => (string)$event->input,
                ] : []
            ));
        }
    }
903953
public function queue($event)
    {
        $connection = $event instanceof ShouldBroadcastNow ? 'sync' : null;

        if (is_null($connection) && isset($event->connection)) {
            $connection = $event->connection;
        }

        $queue = null;

        if (method_exists($event, 'broadcastQueue')) {
            $queue = $event->broadcastQueue();
        } elseif (isset($event->broadcastQueue)) {
            $queue = $event->broadcastQueue;
        } elseif (isset($event->queue)) {
            $queue = $event->queue;
        }

        $this->container->make('queue')->connection($connection)->pushOn(
            $queue, new BroadcastEvent(clone $event)
        );
    }
364982
protected function queueJobProcessingHandler(JobProcessing $event)
    {
        // When a job starts, we want to push a new scope
        Hub::getCurrent()->pushScope();

        $job = [
            'job' => $event->job->getName(),
            'queue' => $event->job->getQueue(),
            'attempts' => $event->job->attempts(),
            'connection' => $event->connectionName,
        ];

        // Resolve name exists only from Laravel 5.3+
        if (method_exists($event->job, 'resolveName')) {
            $job['resolved'] = $event->job->resolveName();
        }

        Integration::addBreadcrumb(new Breadcrumb(
            Breadcrumb::LEVEL_INFO,
            Breadcrumb::TYPE_USER,
            'queue.job',
            'Processing queue job',
            $job
        ));
    }
17777
public function onKickChannels(UserEventInterface $event, EventQueueInterface $queue)
    {
        $this->joinOnMatch($event->getParams()['user'], $event, $queue);
    }
1249108
protected function sendIrcResponse(Event $event, Queue $queue, array $ircResponse)
    {
        foreach ($ircResponse as $ircResponseLine) {
            $this->sendIrcResponseLine($event, $queue, $ircResponseLine);
        }
    }
744787
public function onAddToQueueListenerRun(AddToQueueEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $query = $event->getQuery();
        $this->database->execute($query);
    }