diff --git a/telethon/client/auth.py b/telethon/client/auth.py index 57aabe0c..fab9d41d 100644 --- a/telethon/client/auth.py +++ b/telethon/client/auth.py @@ -233,7 +233,7 @@ class AuthMethods(MessageParseMethods, UserMethods): phone_hash = phone_hash or self._phone_code_hash.get(phone, None) if not phone_hash: - raise ValueError('You also need to provide a phone_hash.') + raise ValueError('You also need to provide a phone_code_hash.') return phone, phone_hash diff --git a/telethon/client/users.py b/telethon/client/users.py index 1779647e..2b0cc220 100644 --- a/telethon/client/users.py +++ b/telethon/client/users.py @@ -60,10 +60,13 @@ class UserMethods(TelegramBaseClient): result = await future self.session.process_entities(result) return result - except (errors.ServerError, errors.RpcCallFailError) as e: + except (errors.ServerError, errors.RpcCallFailError, + errors.RpcMcgetFailError) as e: self._log[__name__].warning( 'Telegram is having internal issues %s: %s', e.__class__.__name__, e) + + await asyncio.sleep(2) except (errors.FloodWaitError, errors.FloodTestPhoneWaitError) as e: if utils.is_list_like(request): request = request[request_index]