Skip to content

Commit

Permalink
+ Add timestamp of answer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Kholodilin committed Nov 23, 2016
1 parent 34916ac commit e20ad5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Chrl/AppBundle/Service/GameService.php
Expand Up @@ -138,9 +138,12 @@ public function checkAnswer($message)

$this->em->persist($pl);

$seconds = new \Datetime('now');
$seconds = $seconds->getTimestamp() - $game->lastQuestionTime->getTimestamp();

$this->botApi->sendMessage(
$game->chatId,
json_decode('"\ud83d\udc4d"').' Correct! @'.$user->getAlias().' gets *'.
json_decode('"\ud83d\udc4d"').' Correct in *'.$seconds.'* secs! @'.$user->getAlias().' gets *'.
$question->price.'* and now has *'.$user->getPoints().'* points!',
'markdown',
false,
Expand Down

0 comments on commit e20ad5b

Please sign in to comment.