insertUser() public static method

Insert users and save their connection to chats
public static insertUser ( Longman\TelegramBot\Entities\User $user, string $date, Chat $chat = null ) : boolean
$user Longman\TelegramBot\Entities\User
$date string
$chat Longman\TelegramBot\Entities\Chat
return boolean If the insert was successful
 /**
  * Start a fake conversation for the passed command and return the randomly generated ids.
  *
  * @return array
  */
 public static function startFakeConversation()
 {
     if (!DB::isDbConnected()) {
         return false;
     }
     //Just get some random values.
     $message_id = mt_rand();
     $user_id = mt_rand();
     $chat_id = mt_rand();
     //Make sure we have a valid user and chat available.
     $message = self::getFakeMessageObject(['message_id' => $message_id], ['id' => $user_id], ['id' => $chat_id]);
     DB::insertMessageRequest($message);
     DB::insertUser($message->getFrom(), null, $message->getChat());
     return compact('message_id', 'user_id', 'chat_id');
 }