From ec0aa65fe12cecaf8489fe94cc392edc3c872c5c Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 22 Sep 2018 19:18:42 +0200 Subject: [PATCH] An user -> a user --- readthedocs/extra/advanced-usage/sessions.rst | 2 +- readthedocs/extra/basic/telegram-client.rst | 4 ++-- readthedocs/extra/examples/chats-and-channels.rst | 6 +++--- readthedocs/extra/examples/users.rst | 2 +- readthedocs/index.rst | 2 +- telethon/client/users.py | 10 +++++----- telethon/events/chataction.py | 2 +- telethon/events/newmessage.py | 2 +- telethon/events/userupdate.py | 4 ++-- telethon/utils.py | 2 +- telethon_generator/data/error_descriptions | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/readthedocs/extra/advanced-usage/sessions.rst b/readthedocs/extra/advanced-usage/sessions.rst index be35c3b6..1b23acd7 100644 --- a/readthedocs/extra/advanced-usage/sessions.rst +++ b/readthedocs/extra/advanced-usage/sessions.rst @@ -23,7 +23,7 @@ talk to the Telegram servers, such as to which IP the client should connect, port, authorization key so that messages can be encrypted, and so on. These files will by default also save all the input entities that you've seen, -so that you can get information about an user or channel by just their ID. +so that you can get information about a user or channel by just their ID. Telegram will **not** send their ``access_hash`` required to retrieve more information about them, if it thinks you have already seem them. For this reason, the library needs to store this information offline. diff --git a/readthedocs/extra/basic/telegram-client.rst b/readthedocs/extra/basic/telegram-client.rst index 2e1e7904..09db60c1 100644 --- a/readthedocs/extra/basic/telegram-client.rst +++ b/readthedocs/extra/basic/telegram-client.rst @@ -47,14 +47,14 @@ how the library refers to either of these: .. code-block:: python - # The method will infer that you've passed an username + # The method will infer that you've passed a username # It also accepts phone numbers, and will get the user # from your contact list. lonami = client.get_entity('lonami') The so called "entities" are another important whole concept on its own, but for now you don't need to worry about it. Simply know that they are -a good way to get information about an user, chat or channel. +a good way to get information about a user, chat or channel. Many other common methods for quick scripts are also available: diff --git a/readthedocs/extra/examples/chats-and-channels.rst b/readthedocs/extra/examples/chats-and-channels.rst index fc0d1d5d..209be5d7 100644 --- a/readthedocs/extra/examples/chats-and-channels.rst +++ b/readthedocs/extra/examples/chats-and-channels.rst @@ -222,7 +222,7 @@ Restricting Users ***************** Similar to how you give or revoke admin permissions, you can edit the -banned rights of an user through :tl:`EditBannedRequest` and its parameter +banned rights of a user through :tl:`EditBannedRequest` and its parameter :tl:`ChannelBannedRights`: .. code-block:: python @@ -232,7 +232,7 @@ banned rights of an user through :tl:`EditBannedRequest` and its parameter from datetime import datetime, timedelta - # Restricting an user for 7 days, only allowing view/send messages. + # Restricting a user for 7 days, only allowing view/send messages. # # Note that it's "reversed". You must set to ``True`` the permissions # you want to REMOVE, and leave as ``None`` those you want to KEEP. @@ -272,7 +272,7 @@ https://core.telegram.org/bots/api#restrictchatmember. Kicking a member **************** -Telegram doesn't actually have a request to kick an user from a group. +Telegram doesn't actually have a request to kick a user from a group. Instead, you need to restrict them so they can't see messages. Any date is enough: diff --git a/readthedocs/extra/examples/users.rst b/readthedocs/extra/examples/users.rst index 85f5ca65..cc5fbe19 100644 --- a/readthedocs/extra/examples/users.rst +++ b/readthedocs/extra/examples/users.rst @@ -11,7 +11,7 @@ Users Retrieving full information *************************** -If you need to retrieve the bio, biography or about information for an user +If you need to retrieve the bio, biography or about information for a user you should use :tl:`GetFullUser`: diff --git a/readthedocs/index.rst b/readthedocs/index.rst index a23d4633..d2b0b62a 100644 --- a/readthedocs/index.rst +++ b/readthedocs/index.rst @@ -25,7 +25,7 @@ when you upgrade! .. note:: The library uses `asyncio `_ under the hood, but you don't need to know anything about it unless you're - going to work with updates! If you're an user of Telethon pre-1.0 and you + going to work with updates! If you're a user of Telethon pre-1.0 and you aren't ready to convert your event handlers into ``async``, you can use `a simpler version `_ (select the "sync" version in ``readthedocs``' bottom left corner). diff --git a/telethon/client/users.py b/telethon/client/users.py index 40b0e92a..fa0c3015 100644 --- a/telethon/client/users.py +++ b/telethon/client/users.py @@ -139,7 +139,7 @@ class UserMethods(TelegramBaseClient): and they will be efficiently fetched from the network. entity (`str` | `int` | :tl:`Peer` | :tl:`InputPeer`): - If an username is given, **the username will be resolved** making + If a username is given, **the username will be resolved** making an API call every time. Resolving usernames is an expensive operation and will start hitting flood waits around 50 usernames in a short period of time. @@ -244,9 +244,9 @@ class UserMethods(TelegramBaseClient): >>> chat = rc(client.get_input_entity(-123456789)) entity (`str` | `int` | :tl:`Peer` | :tl:`InputPeer`): - If an username or invite link is given, **the library will + If a username or invite link is given, **the library will use the cache**. This means that it's possible to be using - an username that *changed* or an old invite link (this only + a username that *changed* or an old invite link (this only happens if an invite link for a small group chat is used after it was upgraded to a mega-group). @@ -267,7 +267,7 @@ class UserMethods(TelegramBaseClient): (prefixed with ``-100``). If a :tl:`Peer` is given, it will be searched exactly in the - cache as either an user, chat or channel. + cache as either a user, chat or channel. If the given object can be turned into an input entity directly, said operation will be done. @@ -343,7 +343,7 @@ class UserMethods(TelegramBaseClient): async def _get_entity_from_string(self, string): """ Gets a full entity from the given string, which may be a phone or - an username, and processes all the found entities on the session. + a username, and processes all the found entities on the session. The string may also be a user link, or a channel/chat invite link. This method has the side effect of adding the found users to the diff --git a/telethon/events/chataction.py b/telethon/events/chataction.py index 7828f2fd..67bab509 100644 --- a/telethon/events/chataction.py +++ b/telethon/events/chataction.py @@ -37,7 +37,7 @@ class ChatAction(EventBuilder): added_by=True, users=msg.from_id) elif isinstance(action, types.MessageActionChatAddUser): - # If an user adds itself, it means they joined + # If a user adds itself, it means they joined added_by = ([msg.from_id] == action.users) or msg.from_id event = cls.Event(msg, added_by=added_by, diff --git a/telethon/events/newmessage.py b/telethon/events/newmessage.py index 0612931a..27de8e68 100644 --- a/telethon/events/newmessage.py +++ b/telethon/events/newmessage.py @@ -191,7 +191,7 @@ class NewMessage(EventBuilder): self.__dict__['_init'] = False if not message.out and isinstance(message.to_id, types.PeerUser): # Incoming message (e.g. from a bot) has to_id=us, and - # from_id=bot (the actual "chat" from an user's perspective). + # from_id=bot (the actual "chat" from a user's perspective). chat_peer = types.PeerUser(message.from_id) else: chat_peer = message.to_id diff --git a/telethon/events/userupdate.py b/telethon/events/userupdate.py index 75c18728..1c0144be 100644 --- a/telethon/events/userupdate.py +++ b/telethon/events/userupdate.py @@ -7,7 +7,7 @@ from ..tl import types @name_inner_event class UserUpdate(EventBuilder): """ - Represents an user update (gone online, offline, joined Telegram). + Represents a user update (gone online, offline, joined Telegram). """ @classmethod def build(cls, update): @@ -22,7 +22,7 @@ class UserUpdate(EventBuilder): class Event(EventCommon): """ - Represents the event of an user status update (last seen, joined). + Represents the event of a user status update (last seen, joined). Members: online (`bool`, optional): diff --git a/telethon/utils.py b/telethon/utils.py index c4009670..60e4c990 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -1,6 +1,6 @@ """ Utilities for working with the Telegram API itself (such as handy methods -to convert between an entity like an User, Chat, etc. into its Input version) +to convert between an entity like a User, Chat, etc. into its Input version) """ import base64 import binascii diff --git a/telethon_generator/data/error_descriptions b/telethon_generator/data/error_descriptions index eaee1ac6..a210672b 100644 --- a/telethon_generator/data/error_descriptions +++ b/telethon_generator/data/error_descriptions @@ -51,7 +51,7 @@ USERNAME_NOT_OCCUPIED=The username is not in use by anyone else yet USERNAME_OCCUPIED=The username is already taken USERS_TOO_FEW=Not enough users (to create a chat, for example) USERS_TOO_MUCH=The maximum number of users has been exceeded (to create a chat, for example) -USER_ID_INVALID=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 +USER_ID_INVALID=Invalid object ID for a 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 ACTIVE_USER_REQUIRED=The method is only available to already activated users AUTH_KEY_INVALID=The key is invalid AUTH_KEY_PERM_EMPTY=The method is unavailable for temporary authorization key, not bound to permanent