/**
  * Responds to a help command.
  *
  * @param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
  * @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
  * @param array $messages
  */
 protected function sendHelpReply(Event $event, Queue $queue, array $messages)
 {
     $method = 'irc' . $event->getCommand();
     $target = $event->getSource();
     foreach ($messages as $message) {
         $queue->{$method}($target, $message);
     }
 }
 /**
  * Displays help information for the quit command.
  *
  * @param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
  * @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
  */
 public function handleQuitHelp(CommandEvent $event, EventQueueInterface $queue)
 {
     $messages = array('Usage: quit', 'Requests that the bot terminate its connection to the current server.', 'See https://tools.ietf.org/html/rfc2812#section-3.1.7');
     $method = 'irc' . $event->getCommand();
     $target = $event->getSource();
     foreach ($messages as $message) {
         $queue->{$method}($target, $message);
     }
 }
 public function queryExpressHelp(Event $event, Queue $queue)
 {
     $msg = "Usage: [ ";
     foreach ($this->commands as $command) {
         $msg .= $command . ' ';
     }
     $msg .= '] [Express ID] -- Query the express status for given ID.';
     $queue->ircPrivmsg($event->getSource(), $msg);
 }
 /**
  * Send a single response line back to IRC
  *
  * @param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
  * @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
  * @param string $ircResponseLine
  */
 protected function sendIrcResponseLine(Event $event, Queue $queue, $ircResponseLine)
 {
     $queue->ircPrivmsg($event->getSource(), $ircResponseLine);
 }
 /**
  * Returns usage information for the command.
  *
  * @param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
  * @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
  */
 public function handleHelp(Event $event, Queue $queue)
 {
     $method = 'irc' . $event->getCommand();
     $target = $event->getSource();
     $messages = array('Usage: thefuckingweather location', 'Returns weather information for the specified location from thefuckingweather.com');
     foreach ($messages as $message) {
         $queue->{$method}($target, $message);
     }
 }
 /**
  * Handles help for the seen command.
  *
  * @param \Phergie\Irc\Plugin\React\Command\CommandEvent $event
  * @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
  */
 public function handleCommandHelp(CommandEvent $event, Queue $queue)
 {
     $queue->ircPrivmsg($event->getSource(), "Usage: seen <nickname>");
 }
Ejemplo n.º 7
0
 protected function parseReminder(Event $event)
 {
     $params = $event->getCustomParams();
     $nick = $event->getNick();
     if (isset($params[1])) {
         $name = $params[1];
     } else {
         $name = null;
     }
     $source = $event->getSource();
     if ($this->forcePMs) {
         $source = $nick;
     }
     $command = 'irc' . $event->getCommand();
     unset($params[0]);
     unset($params[1]);
     $time = join(" ", $params);
     return ['nick' => $nick, 'name' => $name, 'source' => $source, 'command' => $command, 'time' => $time];
 }