| @@ 17-46 (lines=30) @@ | ||
| 14 | Command\AbstractCommand |
|
| 15 | }; |
|
| 16 | ||
| 17 | class Response extends AbstractCommand |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Configures the command |
|
| 21 | */ |
|
| 22 | public function configure() |
|
| 23 | { |
|
| 24 | $this |
|
| 25 | ->setName('emulator:response') |
|
| 26 | ->setDescription('Triggers Webhook with provided JSON string') |
|
| 27 | ->setHelp('Triggers Webhook with provided JSON string') |
|
| 28 | ->addArgument( |
|
| 29 | 'path', |
|
| 30 | InputArgument::REQUIRED, |
|
| 31 | 'Path to bot directory' |
|
| 32 | ) |
|
| 33 | ->addArgument( |
|
| 34 | 'json', |
|
| 35 | InputArgument::REQUIRED, |
|
| 36 | 'Json string' |
|
| 37 | ); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Executes the command |
|
| 42 | * |
|
| 43 | * @param InputInterface $input |
|
| 44 | * @param OutputInterface $output |
|
| 45 | */ |
|
| 46 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 47 | { |
|
| 48 | parent::execute($input, $output); |
|
| 49 | ||
| @@ 17-42 (lines=26) @@ | ||
| 14 | Command\AbstractCommand |
|
| 15 | }; |
|
| 16 | ||
| 17 | class Start extends AbstractCommand |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Configures the command |
|
| 21 | */ |
|
| 22 | public function configure() |
|
| 23 | { |
|
| 24 | $this |
|
| 25 | ->setName('listener:start') |
|
| 26 | ->setDescription('Starts listening for updates, received from the bot') |
|
| 27 | ->setHelp('Starts listening for updates, coming from bot started') |
|
| 28 | ->addArgument( |
|
| 29 | 'path', |
|
| 30 | InputArgument::REQUIRED, |
|
| 31 | 'Path to bot directory' |
|
| 32 | ); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @param InputInterface $input |
|
| 37 | * @param OutputInterface $output |
|
| 38 | */ |
|
| 39 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 40 | { |
|
| 41 | parent::execute($input, $output); |
|
| 42 | ||
| 43 | $botName = $this->config->get('name'); |
|
| 44 | $output->writeln(sprintf('<fg=green;options=bold>%s</> <fg=yellow>started at %s</>', $botName, date('H:i, d.m.Y'))); |
|
| 45 | ||