Example #1
0
 /**
  * [execute description]
  * @param  InputInterface  $input  [description]
  * @param  OutputInterface $output [description]
  * @return [type]          [description]
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $client = new \Slack\Client($input->getOption('team'), $input->getOption('token'));
     $slack = new \Slack\Notifier($client);
     $message = new \Slack\Message\Message($input->getArgument('message'));
     $message->setChannel($input->getArgument('channel'))->setUsername($input->getOption('username'));
     if ($input->getOption('emoji')) {
         $message->setIconEmoji($input->getOption('emoji'));
     }
     $slack->notify($message);
     $output->writeln("Sent!");
 }
 /**
  * Send the update to Slack
  *
  * @since    1.0.0
  */
 public function slack($text)
 {
     //echo("f**k it");
     //die("hit the callback");
     $client = new Slack\Client(MDBP_SLACK_HOOK_URL);
     $slack = new Slack\Notifier($client);
     $message = new Slack\Message\Message($text);
     $message->setChannel(MDBP_SLACK_CHANNEL)->setIconEmoji(':ghost:')->setUsername('slack-php');
     $slack->notify($message);
 }