From cbcbda52769e3998b18075a43ec1d286ee11a0dc Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 17 Jul 2019 12:37:16 +0200 Subject: [PATCH] Minor documentation and type hint updates --- telethon/client/bots.py | 2 +- telethon/client/chats.py | 4 ++-- telethon/client/downloads.py | 2 +- telethon/client/messages.py | 2 +- telethon/client/users.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/telethon/client/bots.py b/telethon/client/bots.py index 72efdd9e..045825b3 100644 --- a/telethon/client/bots.py +++ b/telethon/client/bots.py @@ -16,7 +16,7 @@ class BotMethods: offset: str = None, geo_point: 'types.GeoPoint' = None) -> custom.InlineResults: """ - Makes an inline query to the specified bot (e.g. ``@vote New Poll``). + Makes an inline query to the specified bot (``@vote New Poll``). Arguments bot (`entity`): diff --git a/telethon/client/chats.py b/telethon/client/chats.py index b85ea70c..286bb05a 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -968,11 +968,11 @@ class ChatMethods: from datetime import timedelta # Kicking `user` from `chat` for 1 minute - client.edit_permission(chat, user, timedelta(minutes=1), + client.edit_permissions(chat, user, timedelta(minutes=1), view_messages=False) # Banning `user` from `chat` forever - client.edit_permission(chat, user, view_messages=False) + client.edit_permissions(chat, user, view_messages=False) """ entity = await self.get_input_entity(entity) if not isinstance(entity, types.InputPeerChannel): diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 6b16fc5d..5b73cedb 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -273,7 +273,7 @@ class DownloadMethods: message: 'hints.MessageLike', file: 'hints.FileLike' = None, *, - thumb: 'hints.FileLike' = None, + thumb: 'typing.Union[int, types.TypePhotoSize]' = None, progress_callback: 'hints.ProgressCallback' = None) -> typing.Optional[typing.Union[str, bytes]]: """ Downloads the given media from a message object. diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 4ba8a8ce..084ccdaa 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -521,7 +521,7 @@ class MessageMethods: reply_to: 'typing.Union[int, types.Message]' = None, parse_mode: typing.Optional[str] = (), link_preview: bool = True, - file: 'hints.FileLike' = None, + file: 'typing.Union[hints.FileLike, typing.Sequence[hints.FileLike]]' = None, force_document: bool = False, clear_draft: bool = False, buttons: 'hints.MarkupLike' = None, diff --git a/telethon/client/users.py b/telethon/client/users.py index 33c3737e..6630518f 100644 --- a/telethon/client/users.py +++ b/telethon/client/users.py @@ -166,7 +166,7 @@ class UserMethods: async def is_user_authorized(self: 'TelegramClient') -> bool: """ - Returns `True` if the user is authorized (i.e. has logged in). + Returns `True` if the user is authorized (logged in). Example .. code-block:: python