Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function run($message, $user) |
||
16 | { |
||
17 | $games = $this->gameService->getActiveGames(); |
||
18 | |||
19 | $text = 'Current active games: '."\n"; |
||
20 | |||
21 | /** @var Game $game */ |
||
22 | foreach ($games as $game) { |
||
23 | $text .= '- '.$game->title."\n"; |
||
24 | } |
||
25 | |||
26 | if (count($games) == 0) { |
||
27 | $text .= '- No active games, sorry. Invite me into group, and press /start'; |
||
28 | } |
||
29 | |||
30 | $this->botApi->sendMessage($message['chat']['id'], $text); |
||
31 | } |
||
32 | } |
||
33 |