These methods can be used to wait for a certain amount of time for a result, and then throw an
Amp\TimeoutException or simply continue execution if no result was obtained.// Waits for the result for 2 seconds and then throws an \Amp\TimeoutException
$result = yield $MadelineProto->timeout($promise, 2)
// Waits for the result for 2 seconds, returns the result or null (which is the result of sleep())
$result = yield $MadelineProto->first([$promise, $MadelineProto->sleep(2)]);