| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 30 | { |
||
| 31 | $output->writeln('Executing...'); |
||
| 32 | |||
| 33 | $gs = $this->getContainer()->get('app.gameservice'); |
||
| 34 | $tgApi = $this->getContainer()->get('buktopuha.telegram_bot_api'); |
||
| 35 | $games = $gs->getActiveGames(); |
||
| 36 | |||
| 37 | /** @var Game $game */ |
||
| 38 | foreach ($games as $game) { |
||
| 39 | if($input->getOption('success')) { |
||
| 40 | $tgApi->sendMessage($game->chatId, 'Bot is back online! The game continues...'); |
||
| 41 | } else { |
||
| 42 | $tgApi->sendMessage($game->chatId, 'Bot rebooting due to deploy, sorry. The game will continue once bot boots again.'); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 |