Slack\Command\NotifierCommand::execute PHP Method

execute() protected method

[execute description]
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : [type]
$input Symfony\Component\Console\Input\InputInterface [description]
$output Symfony\Component\Console\Output\OutputInterface [description]
return [type]
    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!");
    }
NotifierCommand