Beispiel #1
0
 /**
  * @param MessageInterface $message
  * @return bool
  */
 private function shouldCallArduino(MessageInterface $message)
 {
     /* @TODO: Add check for available commands */
     $isEmpty = $message->isEmpty();
     return $message instanceof InputMessage && $isEmpty === false;
 }
Beispiel #2
0
 /**
  * @param MessageInterface $message
  */
 public function handleMessage(MessageInterface $message)
 {
     if ($message->isEmpty() === false) {
         $this->slack->sendMessage(Message::createFromString('Repyling to: ' . $message->toString()));
     }
 }
Beispiel #3
0
 /**
  * @param MessageInterface $message
  */
 public function sendMessage(MessageInterface $message)
 {
     $this->commander->execute('chat.postMessage', ['channel' => $this->channel, 'text' => $message->toString(), 'username' => 'ardo', 'icon_url' => 'https://raw.githubusercontent.com/WeCamp/ardo/master/ardo-head.png']);
 }
Beispiel #4
0
 public function handleMessage(MessageInterface $message)
 {
     printf("I am handling this: %s\n", $message->toString());
 }