Skip to content

Commit

Permalink
Update known errors and error message
Browse files Browse the repository at this point in the history
Closes #1713
  • Loading branch information
Lonami committed Mar 7, 2021
1 parent 8724949 commit 3ee94bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion telethon/client/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ async def get_stats(
"""
entity = await self.get_input_entity(entity)
if helpers._entity_type(entity) != helpers._EntityType.CHANNEL:
raise TypeError('You must pass a user entity')
raise TypeError('You must pass a channel entity')

# Don't bother fetching the Channel entity (costs a request), instead
# try to guess and if it fails we know it's the other one (best case
Expand Down
2 changes: 2 additions & 0 deletions telethon_generator/data/errors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ ENCRYPTION_OCCUPY_FAILED,500,TDLib developer claimed it is not an error while ac
ENTITIES_TOO_LONG,400,It is no longer possible to send such long data inside entity tags (for example inline text URLs)
ENTITY_MENTION_USER_INVALID,400,You can't use this entity
ERROR_TEXT_EMPTY,400,The provided error message is empty
EXPIRE_FORBIDDEN,400,
EXPORT_CARD_INVALID,400,Provided card is invalid
EXTERNAL_URL_INVALID,400,External URL invalid
FIELD_NAME_EMPTY,400,The field with the name FIELD_NAME is missing
Expand Down Expand Up @@ -176,6 +177,7 @@ MEDIA_EMPTY,400,The provided media object is invalid or the current account may
MEDIA_INVALID,400,Media invalid
MEDIA_NEW_INVALID,400,The new media to edit the message with is invalid (such as stickers or voice notes)
MEDIA_PREV_INVALID,400,The old media cannot be edited with anything else (such as stickers or voice notes)
MEDIA_TTL_INVALID,400,
MEGAGROUP_ID_INVALID,400,The group is invalid
MEGAGROUP_PREHISTORY_HIDDEN,400,You can't set this discussion group because it's history is hidden
MEGAGROUP_REQUIRED,400,The request can only be used with a megagroup channel
Expand Down

0 comments on commit 3ee94bd

Please sign in to comment.