mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-16 19:41:07 +03:00
Fix some misleading errors/documentation
This commit is contained in:
parent
2a3e5e5ed2
commit
e0e3947d2f
|
@ -22,7 +22,9 @@ class ChannelInvalidError(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'Invalid channel object. Make sure to pass the right types.'
|
'Invalid channel object. Make sure to pass the right types,'
|
||||||
|
' for instance making sure that the request is designed for '
|
||||||
|
'channels or otherwise look for a different one more suited.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +42,12 @@ class ChatIdInvalidError(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'Invalid object ID for a chat. Make sure to pass the right types.'
|
'Invalid object ID for a chat. Make sure to pass the right types,'
|
||||||
|
' for instance making sure that the request is designed for chats'
|
||||||
|
' (not channels/megagroups) or otherwise look for a different one'
|
||||||
|
' more suited.\nAn example working with a megagroup and'
|
||||||
|
' AddChatUserRequest, it will fail because megagroups are channels'
|
||||||
|
'. Use InviteToChannelRequest instead.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +55,8 @@ class ConnectionLangPackInvalid(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'The specified language pack is not valid.'
|
'The specified language pack is not valid. This is meant to be '
|
||||||
|
'used by official applications only so far, leave it empty.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,7 +292,7 @@ class UsernameInvalidError(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'Unacceptable username. Must match r"[a-zA-Z][\w\d]{4,31}"'
|
'Unacceptable username. Must match r"[a-zA-Z][\w\d]{4,31}".'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -292,7 +300,7 @@ class UsernameNotModifiedError(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'The username is not different from the current username'
|
'The username is not different from the current username.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -300,7 +308,7 @@ class UsernameNotOccupiedError(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'See issue #96 for Telethon - try upgrading the library.'
|
'The username is not in use by anyone else yet.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -333,7 +341,9 @@ class UserIdInvalidError(BadRequestError):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super(Exception, self).__init__(
|
super(Exception, self).__init__(
|
||||||
self,
|
self,
|
||||||
'Invalid object ID for an user. Make sure to pass the right types.'
|
'Invalid object ID for an user. Make sure to pass the right types,'
|
||||||
|
'for instance making sure that the request is designed for users'
|
||||||
|
'or otherwise look for a different one more suited.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -292,8 +292,7 @@ class TelegramClient(TelegramBareClient):
|
||||||
|
|
||||||
If no phone or code is provided, then the sole password will be used.
|
If no phone or code is provided, then the sole password will be used.
|
||||||
The password should be used after a normal authorization attempt
|
The password should be used after a normal authorization attempt
|
||||||
has happened and an RPCError with `.password_required = True` was
|
has happened and an SessionPasswordNeededError was raised.
|
||||||
raised.
|
|
||||||
|
|
||||||
To login as a bot, only `bot_token` should be provided.
|
To login as a bot, only `bot_token` should be provided.
|
||||||
This should equal to the bot access hash provided by
|
This should equal to the bot access hash provided by
|
||||||
|
|
Loading…
Reference in New Issue
Block a user