public function storeUserIfMissing ($message) {
    $userId = $message['from']['id'];
    $username = strtolower($message['from']['username']);

    $query = $this->database->pdo->prepare('SELECT username FROM users WHERE userId = :userId');
    $query->bindParam(':userId', $userId);
    $query->execute();

    $user = $query->fetch(PDO::FETCH_ASSOC) ?? false;

    // If the user is not registered.
    if (!$user) {
      $query = $this->database->pdo->prepare('INSERT INTO users (userId, username, points) VALUES(:userId, :username, 0)');
      $query->bindParam(':userId', $userId);
      $query->bindParam(':username', $username);

      $query->execute();
      return;
    }

    // If the username changed.
    if ($username !== $user['username']) {
      $query = $this->database->pdo->prepare('UPDATE users SET username = :username WHERE userId = :userId');
      $query->bindParam(':userId', $userId);
      $query->bindParam(':username', $username);

      $query->execute();
    }
  }