/** * @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; }
/** * @param MessageInterface $message */ public function handleMessage(MessageInterface $message) { if ($message->isEmpty() === false) { $this->slack->sendMessage(Message::createFromString('Repyling to: ' . $message->toString())); } }
/** * @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']); }
public function handleMessage(MessageInterface $message) { printf("I am handling this: %s\n", $message->toString()); }