An user -> a user

This commit is contained in:
Lonami Exo
2018-09-22 19:18:42 +02:00
parent d5d3733fd4
commit ec0aa65fe1
11 changed files with 19 additions and 19 deletions
+5 -5
View File
@@ -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
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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):
+1 -1
View File
@@ -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