From 3e18945f3ccbbce3eb7a4b506c531a616a981583 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 16 Mar 2019 19:23:23 +0100 Subject: [PATCH] Reformat code --- pyrogram/api/errors/__init__.py | 2 +- .../methods/bots/answer_callback_query.py | 14 +- .../methods/bots/get_game_high_scores.py | 10 +- .../methods/bots/get_inline_bot_results.py | 14 +- .../methods/bots/request_callback_answer.py | 10 +- pyrogram/client/methods/bots/send_game.py | 22 ++-- .../methods/bots/send_inline_bot_result.py | 16 ++- .../client/methods/bots/set_game_score.py | 16 ++- .../client/methods/chats/delete_chat_photo.py | 6 +- .../methods/chats/export_chat_invite_link.py | 6 +- pyrogram/client/methods/chats/get_chat.py | 6 +- .../client/methods/chats/get_chat_member.py | 8 +- .../client/methods/chats/get_chat_members.py | 14 +- .../methods/chats/get_chat_members_count.py | 6 +- .../client/methods/chats/get_chat_preview.py | 6 +- pyrogram/client/methods/chats/get_dialogs.py | 10 +- .../client/methods/chats/iter_chat_members.py | 12 +- pyrogram/client/methods/chats/iter_dialogs.py | 8 +- pyrogram/client/methods/chats/join_chat.py | 6 +- .../client/methods/chats/kick_chat_member.py | 10 +- pyrogram/client/methods/chats/leave_chat.py | 8 +- .../client/methods/chats/pin_chat_message.py | 12 +- .../methods/chats/promote_chat_member.py | 24 ++-- .../methods/chats/set_chat_description.py | 8 +- .../client/methods/chats/set_chat_photo.py | 8 +- .../client/methods/chats/set_chat_title.py | 8 +- .../client/methods/chats/unban_chat_member.py | 8 +- .../methods/chats/unpin_chat_message.py | 6 +- .../methods/chats/update_chat_username.py | 8 +- .../client/methods/contacts/add_contacts.py | 6 +- .../methods/contacts/delete_contacts.py | 6 +- .../methods/decorators/on_callback_query.py | 8 +- .../methods/decorators/on_deleted_messages.py | 8 +- .../client/methods/decorators/on_message.py | 8 +- .../methods/decorators/on_raw_update.py | 6 +- .../methods/decorators/on_user_status.py | 8 +- .../client/methods/messages/close_poll.py | 8 +- .../methods/messages/delete_messages.py | 10 +- .../client/methods/messages/download_media.py | 14 +- .../methods/messages/edit_message_caption.py | 14 +- .../methods/messages/edit_message_media.py | 12 +- .../messages/edit_message_reply_markup.py | 10 +- .../methods/messages/edit_message_text.py | 16 ++- .../methods/messages/forward_messages.py | 12 +- .../client/methods/messages/get_history.py | 16 ++- .../client/methods/messages/get_messages.py | 12 +- .../client/methods/messages/iter_history.py | 16 ++- .../client/methods/messages/retract_vote.py | 8 +- .../client/methods/messages/send_animation.py | 38 +++--- .../client/methods/messages/send_audio.py | 38 +++--- .../methods/messages/send_chat_action.py | 10 +- .../client/methods/messages/send_contact.py | 28 ++-- .../client/methods/messages/send_document.py | 32 +++-- .../client/methods/messages/send_location.py | 24 ++-- .../methods/messages/send_media_group.py | 12 +- .../client/methods/messages/send_message.py | 26 ++-- .../client/methods/messages/send_photo.py | 32 +++-- pyrogram/client/methods/messages/send_poll.py | 24 ++-- .../client/methods/messages/send_sticker.py | 26 ++-- .../client/methods/messages/send_venue.py | 32 +++-- .../client/methods/messages/send_video.py | 40 +++--- .../methods/messages/send_video_note.py | 32 +++-- .../client/methods/messages/send_voice.py | 32 +++-- pyrogram/client/methods/messages/vote_poll.py | 10 +- .../methods/password/change_cloud_password.py | 10 +- .../methods/password/enable_cloud_password.py | 10 +- .../methods/password/remove_cloud_password.py | 6 +- .../users/delete_user_profile_photos.py | 6 +- .../methods/users/get_user_profile_photos.py | 10 +- pyrogram/client/methods/users/get_users.py | 6 +- .../methods/users/set_user_profile_photo.py | 6 +- .../client/methods/users/update_username.py | 6 +- pyrogram/client/types/bots/callback_query.py | 20 +-- pyrogram/client/types/bots/force_reply.py | 4 +- pyrogram/client/types/bots/game_high_score.py | 12 +- .../client/types/bots/game_high_scores.py | 10 +- .../types/bots/inline_keyboard_button.py | 14 +- .../types/bots/inline_keyboard_markup.py | 4 +- pyrogram/client/types/bots/keyboard_button.py | 8 +- .../types/bots/reply_keyboard_markup.py | 10 +- .../types/bots/reply_keyboard_remove.py | 4 +- .../client/types/input_media/input_media.py | 8 +- .../input_media/input_media_animation.py | 16 +-- .../types/input_media/input_media_audio.py | 16 +-- .../types/input_media/input_media_document.py | 10 +- .../types/input_media/input_media_photo.py | 8 +- .../types/input_media/input_media_video.py | 18 +-- .../types/input_media/input_phone_contact.py | 8 +- .../types/messages_and_media/animation.py | 24 ++-- .../client/types/messages_and_media/audio.py | 24 ++-- .../types/messages_and_media/contact.py | 16 +-- .../types/messages_and_media/document.py | 18 +-- .../client/types/messages_and_media/game.py | 18 +-- .../types/messages_and_media/location.py | 10 +- .../types/messages_and_media/message.py | 122 +++++++++--------- .../messages_and_media/message_entity.py | 16 +-- .../types/messages_and_media/messages.py | 10 +- .../client/types/messages_and_media/photo.py | 12 +- .../types/messages_and_media/photo_size.py | 14 +- .../client/types/messages_and_media/poll.py | 18 +-- .../types/messages_and_media/poll_option.py | 12 +- .../types/messages_and_media/sticker.py | 26 ++-- .../messages_and_media/user_profile_photos.py | 10 +- .../client/types/messages_and_media/venue.py | 16 +-- .../client/types/messages_and_media/video.py | 24 ++-- .../types/messages_and_media/video_note.py | 20 +-- .../client/types/messages_and_media/voice.py | 18 +-- pyrogram/client/types/user_and_chats/chat.py | 36 +++--- .../types/user_and_chats/chat_member.py | 20 +-- .../types/user_and_chats/chat_members.py | 10 +- .../client/types/user_and_chats/chat_photo.py | 10 +- .../types/user_and_chats/chat_preview.py | 16 +-- .../client/types/user_and_chats/dialog.py | 18 +-- .../client/types/user_and_chats/dialogs.py | 10 +- pyrogram/client/types/user_and_chats/user.py | 34 ++--- .../types/user_and_chats/user_status.py | 22 ++-- pyrogram/session/auth.py | 16 +-- 117 files changed, 974 insertions(+), 802 deletions(-) diff --git a/pyrogram/api/errors/__init__.py b/pyrogram/api/errors/__init__.py index ca65619c..8a1dc699 100644 --- a/pyrogram/api/errors/__init__.py +++ b/pyrogram/api/errors/__init__.py @@ -16,5 +16,5 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from .exceptions import * from .error import UnknownError +from .exceptions import * diff --git a/pyrogram/client/methods/bots/answer_callback_query.py b/pyrogram/client/methods/bots/answer_callback_query.py index 5e8468e5..87fc458a 100644 --- a/pyrogram/client/methods/bots/answer_callback_query.py +++ b/pyrogram/client/methods/bots/answer_callback_query.py @@ -21,12 +21,14 @@ from pyrogram.client.ext import BaseClient class AnswerCallbackQuery(BaseClient): - def answer_callback_query(self, - callback_query_id: str, - text: str = None, - show_alert: bool = None, - url: str = None, - cache_time: int = 0): + def answer_callback_query( + self, + callback_query_id: str, + text: str = None, + show_alert: bool = None, + url: str = None, + cache_time: int = 0 + ): """Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. diff --git a/pyrogram/client/methods/bots/get_game_high_scores.py b/pyrogram/client/methods/bots/get_game_high_scores.py index ad4f8b4a..e782dadc 100644 --- a/pyrogram/client/methods/bots/get_game_high_scores.py +++ b/pyrogram/client/methods/bots/get_game_high_scores.py @@ -24,10 +24,12 @@ from pyrogram.client.ext import BaseClient class GetGameHighScores(BaseClient): - def get_game_high_scores(self, - user_id: Union[int, str], - chat_id: Union[int, str], - message_id: int = None): + def get_game_high_scores( + self, + user_id: Union[int, str], + chat_id: Union[int, str], + message_id: int = None + ): """Use this method to get data for high score tables. Args: diff --git a/pyrogram/client/methods/bots/get_inline_bot_results.py b/pyrogram/client/methods/bots/get_inline_bot_results.py index e76a0d1d..7c94bcf3 100644 --- a/pyrogram/client/methods/bots/get_inline_bot_results.py +++ b/pyrogram/client/methods/bots/get_inline_bot_results.py @@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient class GetInlineBotResults(BaseClient): - def get_inline_bot_results(self, - bot: Union[int, str], - query: str, - offset: str = "", - latitude: float = None, - longitude: float = None): + def get_inline_bot_results( + self, + bot: Union[int, str], + query: str, + offset: str = "", + latitude: float = None, + longitude: float = None + ): """Use this method to get bot results via inline queries. You can then send a result using :obj:`send_inline_bot_result ` diff --git a/pyrogram/client/methods/bots/request_callback_answer.py b/pyrogram/client/methods/bots/request_callback_answer.py index 74e2d26d..0d440fd9 100644 --- a/pyrogram/client/methods/bots/request_callback_answer.py +++ b/pyrogram/client/methods/bots/request_callback_answer.py @@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient class RequestCallbackAnswer(BaseClient): - def request_callback_answer(self, - chat_id: Union[int, str], - message_id: int, - callback_data: bytes): + def request_callback_answer( + self, + chat_id: Union[int, str], + message_id: int, + callback_data: bytes + ): """Use this method to request a callback answer from bots. This is the equivalent of clicking an inline button containing callback data. diff --git a/pyrogram/client/methods/bots/send_game.py b/pyrogram/client/methods/bots/send_game.py index 401a5aa6..c396ee85 100644 --- a/pyrogram/client/methods/bots/send_game.py +++ b/pyrogram/client/methods/bots/send_game.py @@ -24,15 +24,19 @@ from pyrogram.client.ext import BaseClient class SendGame(BaseClient): - def send_game(self, - chat_id: Union[int, str], - game_short_name: str, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None) -> "pyrogram.Message": + def send_game( + self, + chat_id: Union[int, str], + game_short_name: str, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None + ) -> "pyrogram.Message": """Use this method to send a game. Args: diff --git a/pyrogram/client/methods/bots/send_inline_bot_result.py b/pyrogram/client/methods/bots/send_inline_bot_result.py index 66caab16..6cfc6295 100644 --- a/pyrogram/client/methods/bots/send_inline_bot_result.py +++ b/pyrogram/client/methods/bots/send_inline_bot_result.py @@ -23,13 +23,15 @@ from pyrogram.client.ext import BaseClient class SendInlineBotResult(BaseClient): - def send_inline_bot_result(self, - chat_id: Union[int, str], - query_id: int, - result_id: str, - disable_notification: bool = None, - reply_to_message_id: int = None, - hide_via: bool = None): + def send_inline_bot_result( + self, + chat_id: Union[int, str], + query_id: int, + result_id: str, + disable_notification: bool = None, + reply_to_message_id: int = None, + hide_via: bool = None + ): """Use this method to send an inline bot result. Bot results can be retrieved using :obj:`get_inline_bot_results ` diff --git a/pyrogram/client/methods/bots/set_game_score.py b/pyrogram/client/methods/bots/set_game_score.py index e9d20844..337576a9 100644 --- a/pyrogram/client/methods/bots/set_game_score.py +++ b/pyrogram/client/methods/bots/set_game_score.py @@ -24,13 +24,15 @@ from pyrogram.client.ext import BaseClient class SetGameScore(BaseClient): - def set_game_score(self, - user_id: Union[int, str], - score: int, - force: bool = None, - disable_edit_message: bool = None, - chat_id: Union[int, str] = None, - message_id: int = None): + def set_game_score( + self, + user_id: Union[int, str], + score: int, + force: bool = None, + disable_edit_message: bool = None, + chat_id: Union[int, str] = None, + message_id: int = None + ): # inline_message_id: str = None): TODO Add inline_message_id """Use this method to set the score of the specified user in a game. diff --git a/pyrogram/client/methods/chats/delete_chat_photo.py b/pyrogram/client/methods/chats/delete_chat_photo.py index 0164ff43..2473e123 100644 --- a/pyrogram/client/methods/chats/delete_chat_photo.py +++ b/pyrogram/client/methods/chats/delete_chat_photo.py @@ -23,8 +23,10 @@ from ...ext import BaseClient class DeleteChatPhoto(BaseClient): - def delete_chat_photo(self, - chat_id: Union[int, str]) -> bool: + def delete_chat_photo( + self, + chat_id: Union[int, str] + ) -> bool: """Use this method to delete a chat photo. Photos can't be changed for private chats. You must be an administrator in the chat for this to work and must have the appropriate admin rights. diff --git a/pyrogram/client/methods/chats/export_chat_invite_link.py b/pyrogram/client/methods/chats/export_chat_invite_link.py index 39f1a2fe..88056344 100644 --- a/pyrogram/client/methods/chats/export_chat_invite_link.py +++ b/pyrogram/client/methods/chats/export_chat_invite_link.py @@ -23,8 +23,10 @@ from ...ext import BaseClient class ExportChatInviteLink(BaseClient): - def export_chat_invite_link(self, - chat_id: Union[int, str]) -> str: + def export_chat_invite_link( + self, + chat_id: Union[int, str] + ) -> str: """Use this method to generate a new invite link for a chat; any previously generated link is revoked. You must be an administrator in the chat for this to work and have the appropriate admin rights. diff --git a/pyrogram/client/methods/chats/get_chat.py b/pyrogram/client/methods/chats/get_chat.py index 9db34669..89a72722 100644 --- a/pyrogram/client/methods/chats/get_chat.py +++ b/pyrogram/client/methods/chats/get_chat.py @@ -24,8 +24,10 @@ from ...ext import BaseClient class GetChat(BaseClient): - def get_chat(self, - chat_id: Union[int, str]) -> "pyrogram.Chat": + def get_chat( + self, + chat_id: Union[int, str] + ) -> "pyrogram.Chat": """Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.) diff --git a/pyrogram/client/methods/chats/get_chat_member.py b/pyrogram/client/methods/chats/get_chat_member.py index 7ed4104b..d8315010 100644 --- a/pyrogram/client/methods/chats/get_chat_member.py +++ b/pyrogram/client/methods/chats/get_chat_member.py @@ -24,9 +24,11 @@ from ...ext import BaseClient class GetChatMember(BaseClient): - def get_chat_member(self, - chat_id: Union[int, str], - user_id: Union[int, str]) -> "pyrogram.ChatMember": + def get_chat_member( + self, + chat_id: Union[int, str], + user_id: Union[int, str] + ) -> "pyrogram.ChatMember": """Use this method to get information about one member of a chat. Args: diff --git a/pyrogram/client/methods/chats/get_chat_members.py b/pyrogram/client/methods/chats/get_chat_members.py index 6c56b532..0b07f674 100644 --- a/pyrogram/client/methods/chats/get_chat_members.py +++ b/pyrogram/client/methods/chats/get_chat_members.py @@ -33,12 +33,14 @@ class Filters: class GetChatMembers(BaseClient): - def get_chat_members(self, - chat_id: Union[int, str], - offset: int = 0, - limit: int = 200, - query: str = "", - filter: str = Filters.ALL) -> "pyrogram.ChatMembers": + def get_chat_members( + self, + chat_id: Union[int, str], + offset: int = 0, + limit: int = 200, + query: str = "", + filter: str = Filters.ALL + ) -> "pyrogram.ChatMembers": """Use this method to get a chunk of the members list of a chat. You can get up to 200 chat members at once. diff --git a/pyrogram/client/methods/chats/get_chat_members_count.py b/pyrogram/client/methods/chats/get_chat_members_count.py index 9360b64f..9e79d5fa 100644 --- a/pyrogram/client/methods/chats/get_chat_members_count.py +++ b/pyrogram/client/methods/chats/get_chat_members_count.py @@ -23,8 +23,10 @@ from ...ext import BaseClient class GetChatMembersCount(BaseClient): - def get_chat_members_count(self, - chat_id: Union[int, str]) -> int: + def get_chat_members_count( + self, + chat_id: Union[int, str] + ) -> int: """Use this method to get the number of members in a chat. Args: diff --git a/pyrogram/client/methods/chats/get_chat_preview.py b/pyrogram/client/methods/chats/get_chat_preview.py index 434c385b..28e84c79 100644 --- a/pyrogram/client/methods/chats/get_chat_preview.py +++ b/pyrogram/client/methods/chats/get_chat_preview.py @@ -22,8 +22,10 @@ from ...ext import BaseClient class GetChatPreview(BaseClient): - def get_chat_preview(self, - invite_link: str): + def get_chat_preview( + self, + invite_link: str + ): """Use this method to get the preview of a chat using the invite link. This method only returns a chat preview, if you want to join a chat use :meth:`join_chat` diff --git a/pyrogram/client/methods/chats/get_dialogs.py b/pyrogram/client/methods/chats/get_dialogs.py index c5fe6cfb..b73d0efa 100644 --- a/pyrogram/client/methods/chats/get_dialogs.py +++ b/pyrogram/client/methods/chats/get_dialogs.py @@ -28,10 +28,12 @@ log = logging.getLogger(__name__) class GetDialogs(BaseClient): - def get_dialogs(self, - offset_date: int = 0, - limit: int = 100, - pinned_only: bool = False) -> "pyrogram.Dialogs": + def get_dialogs( + self, + offset_date: int = 0, + limit: int = 100, + pinned_only: bool = False + ) -> "pyrogram.Dialogs": """Use this method to get a chunk of the user's dialogs You can get up to 100 dialogs at once. diff --git a/pyrogram/client/methods/chats/iter_chat_members.py b/pyrogram/client/methods/chats/iter_chat_members.py index b0aeb51b..0886d6c6 100644 --- a/pyrogram/client/methods/chats/iter_chat_members.py +++ b/pyrogram/client/methods/chats/iter_chat_members.py @@ -38,11 +38,13 @@ QUERYABLE_FILTERS = (Filters.ALL, Filters.KICKED, Filters.RESTRICTED) class IterChatMembers(BaseClient): - def iter_chat_members(self, - chat_id: Union[int, str], - limit: int = 0, - query: str = "", - filter: str = Filters.ALL) -> Generator["pyrogram.ChatMember", None, None]: + def iter_chat_members( + self, + chat_id: Union[int, str], + limit: int = 0, + query: str = "", + filter: str = Filters.ALL + ) -> Generator["pyrogram.ChatMember", None, None]: """Use this method to iterate through the members of a chat sequentially. This convenience method does the same as repeatedly calling :meth:`get_chat_members` in a loop, thus saving you diff --git a/pyrogram/client/methods/chats/iter_dialogs.py b/pyrogram/client/methods/chats/iter_dialogs.py index 6058cd17..a5fdb35e 100644 --- a/pyrogram/client/methods/chats/iter_dialogs.py +++ b/pyrogram/client/methods/chats/iter_dialogs.py @@ -23,9 +23,11 @@ from ...ext import BaseClient class IterDialogs(BaseClient): - def iter_dialogs(self, - offset_date: int = 0, - limit: int = 0) -> Generator["pyrogram.Dialog", None, None]: + def iter_dialogs( + self, + offset_date: int = 0, + limit: int = 0 + ) -> Generator["pyrogram.Dialog", None, None]: """Use this method to iterate through a user's dialogs sequentially. This convenience method does the same as repeatedly calling :meth:`get_dialogs` in a loop, thus saving you from diff --git a/pyrogram/client/methods/chats/join_chat.py b/pyrogram/client/methods/chats/join_chat.py index b50e50c6..1ee680bf 100644 --- a/pyrogram/client/methods/chats/join_chat.py +++ b/pyrogram/client/methods/chats/join_chat.py @@ -22,8 +22,10 @@ from ...ext import BaseClient class JoinChat(BaseClient): - def join_chat(self, - chat_id: str): + def join_chat( + self, + chat_id: str + ): """Use this method to join a group chat or channel. Args: diff --git a/pyrogram/client/methods/chats/kick_chat_member.py b/pyrogram/client/methods/chats/kick_chat_member.py index 49b3dcfd..ef0d7d55 100644 --- a/pyrogram/client/methods/chats/kick_chat_member.py +++ b/pyrogram/client/methods/chats/kick_chat_member.py @@ -24,10 +24,12 @@ from ...ext import BaseClient class KickChatMember(BaseClient): - def kick_chat_member(self, - chat_id: Union[int, str], - user_id: Union[int, str], - until_date: int = 0) -> Union["pyrogram.Message", bool]: + def kick_chat_member( + self, + chat_id: Union[int, str], + user_id: Union[int, str], + until_date: int = 0 + ) -> Union["pyrogram.Message", bool]: """Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. You must be an administrator in the chat for this to work and must diff --git a/pyrogram/client/methods/chats/leave_chat.py b/pyrogram/client/methods/chats/leave_chat.py index 5b765ac0..9f41a0cc 100644 --- a/pyrogram/client/methods/chats/leave_chat.py +++ b/pyrogram/client/methods/chats/leave_chat.py @@ -23,9 +23,11 @@ from ...ext import BaseClient class LeaveChat(BaseClient): - def leave_chat(self, - chat_id: Union[int, str], - delete: bool = False): + def leave_chat( + self, + chat_id: Union[int, str], + delete: bool = False + ): """Use this method to leave a group chat or channel. Args: diff --git a/pyrogram/client/methods/chats/pin_chat_message.py b/pyrogram/client/methods/chats/pin_chat_message.py index bb70f9e8..682f595d 100644 --- a/pyrogram/client/methods/chats/pin_chat_message.py +++ b/pyrogram/client/methods/chats/pin_chat_message.py @@ -23,10 +23,12 @@ from ...ext import BaseClient class PinChatMessage(BaseClient): - def pin_chat_message(self, - chat_id: Union[int, str], - message_id: int, - disable_notification: bool = None) -> bool: + def pin_chat_message( + self, + chat_id: Union[int, str], + message_id: int, + disable_notification: bool = None + ) -> bool: """Use this method to pin a message in a group, channel or your own chat. You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in the supergroup or "can_edit_messages" admin right in the channel. @@ -55,3 +57,5 @@ class PinChatMessage(BaseClient): silent=disable_notification or None ) ) + + return True diff --git a/pyrogram/client/methods/chats/promote_chat_member.py b/pyrogram/client/methods/chats/promote_chat_member.py index d1f942c2..f3359c5f 100644 --- a/pyrogram/client/methods/chats/promote_chat_member.py +++ b/pyrogram/client/methods/chats/promote_chat_member.py @@ -23,17 +23,19 @@ from ...ext import BaseClient class PromoteChatMember(BaseClient): - def promote_chat_member(self, - chat_id: Union[int, str], - user_id: Union[int, str], - can_change_info: bool = True, - can_post_messages: bool = False, - can_edit_messages: bool = False, - can_delete_messages: bool = True, - can_restrict_members: bool = True, - can_invite_users: bool = True, - can_pin_messages: bool = False, - can_promote_members: bool = False) -> bool: + def promote_chat_member( + self, + chat_id: Union[int, str], + user_id: Union[int, str], + can_change_info: bool = True, + can_post_messages: bool = False, + can_edit_messages: bool = False, + can_delete_messages: bool = True, + can_restrict_members: bool = True, + can_invite_users: bool = True, + can_pin_messages: bool = False, + can_promote_members: bool = False + ) -> bool: """Use this method to promote or demote a user in a supergroup or a channel. You must be an administrator in the chat for this to work and must have the appropriate admin rights. diff --git a/pyrogram/client/methods/chats/set_chat_description.py b/pyrogram/client/methods/chats/set_chat_description.py index e6c5bba1..795c0504 100644 --- a/pyrogram/client/methods/chats/set_chat_description.py +++ b/pyrogram/client/methods/chats/set_chat_description.py @@ -23,9 +23,11 @@ from ...ext import BaseClient class SetChatDescription(BaseClient): - def set_chat_description(self, - chat_id: Union[int, str], - description: str) -> bool: + def set_chat_description( + self, + chat_id: Union[int, str], + description: str + ) -> bool: """Use this method to change the description of a supergroup or a channel. You must be an administrator in the chat for this to work and must have the appropriate admin rights. diff --git a/pyrogram/client/methods/chats/set_chat_photo.py b/pyrogram/client/methods/chats/set_chat_photo.py index cc5c776a..e2fdaab2 100644 --- a/pyrogram/client/methods/chats/set_chat_photo.py +++ b/pyrogram/client/methods/chats/set_chat_photo.py @@ -26,9 +26,11 @@ from ...ext import BaseClient class SetChatPhoto(BaseClient): - def set_chat_photo(self, - chat_id: Union[int, str], - photo: str) -> bool: + def set_chat_photo( + self, + chat_id: Union[int, str], + photo: str + ) -> bool: """Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. You must be an administrator in the chat for this to work and must have the appropriate admin rights. diff --git a/pyrogram/client/methods/chats/set_chat_title.py b/pyrogram/client/methods/chats/set_chat_title.py index fff330ee..1c953ee1 100644 --- a/pyrogram/client/methods/chats/set_chat_title.py +++ b/pyrogram/client/methods/chats/set_chat_title.py @@ -23,9 +23,11 @@ from ...ext import BaseClient class SetChatTitle(BaseClient): - def set_chat_title(self, - chat_id: Union[int, str], - title: str) -> bool: + def set_chat_title( + self, + chat_id: Union[int, str], + title: str + ) -> bool: """Use this method to change the title of a chat. Titles can't be changed for private chats. You must be an administrator in the chat for this to work and must have the appropriate admin rights. diff --git a/pyrogram/client/methods/chats/unban_chat_member.py b/pyrogram/client/methods/chats/unban_chat_member.py index 4c68b14f..3000648f 100644 --- a/pyrogram/client/methods/chats/unban_chat_member.py +++ b/pyrogram/client/methods/chats/unban_chat_member.py @@ -23,9 +23,11 @@ from ...ext import BaseClient class UnbanChatMember(BaseClient): - def unban_chat_member(self, - chat_id: Union[int, str], - user_id: Union[int, str]) -> bool: + def unban_chat_member( + self, + chat_id: Union[int, str], + user_id: Union[int, str] + ) -> bool: """Use this method to unban a previously kicked user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. You must be an administrator for this to work. diff --git a/pyrogram/client/methods/chats/unpin_chat_message.py b/pyrogram/client/methods/chats/unpin_chat_message.py index 4355010d..8030d966 100644 --- a/pyrogram/client/methods/chats/unpin_chat_message.py +++ b/pyrogram/client/methods/chats/unpin_chat_message.py @@ -23,8 +23,10 @@ from ...ext import BaseClient class UnpinChatMessage(BaseClient): - def unpin_chat_message(self, - chat_id: Union[int, str]) -> bool: + def unpin_chat_message( + self, + chat_id: Union[int, str] + ) -> bool: """Use this method to unpin a message in a group, channel or your own chat. You must be an administrator in the chat for this to work and must have the "can_pin_messages" admin right in the supergroup or "can_edit_messages" admin right in the channel. diff --git a/pyrogram/client/methods/chats/update_chat_username.py b/pyrogram/client/methods/chats/update_chat_username.py index 353c338e..cc6416a9 100644 --- a/pyrogram/client/methods/chats/update_chat_username.py +++ b/pyrogram/client/methods/chats/update_chat_username.py @@ -23,9 +23,11 @@ from ...ext import BaseClient class UpdateChatUsername(BaseClient): - def update_chat_username(self, - chat_id: Union[int, str], - username: Union[str, None]) -> bool: + def update_chat_username( + self, + chat_id: Union[int, str], + username: Union[str, None] + ) -> bool: """Use this method to update a channel or a supergroup username. To update your own username (for users only, not bots) you can use :meth:`update_username`. diff --git a/pyrogram/client/methods/contacts/add_contacts.py b/pyrogram/client/methods/contacts/add_contacts.py index 48575a78..aa98fef2 100644 --- a/pyrogram/client/methods/contacts/add_contacts.py +++ b/pyrogram/client/methods/contacts/add_contacts.py @@ -24,8 +24,10 @@ from ...ext import BaseClient class AddContacts(BaseClient): - def add_contacts(self, - contacts: List["pyrogram.InputPhoneContact"]): + def add_contacts( + self, + contacts: List["pyrogram.InputPhoneContact"] + ): """Use this method to add contacts to your Telegram address book. Args: diff --git a/pyrogram/client/methods/contacts/delete_contacts.py b/pyrogram/client/methods/contacts/delete_contacts.py index dba2581d..c7e7c0e6 100644 --- a/pyrogram/client/methods/contacts/delete_contacts.py +++ b/pyrogram/client/methods/contacts/delete_contacts.py @@ -24,8 +24,10 @@ from ...ext import BaseClient class DeleteContacts(BaseClient): - def delete_contacts(self, - ids: List[int]): + def delete_contacts( + self, + ids: List[int] + ): """Use this method to delete contacts from your Telegram address book Args: diff --git a/pyrogram/client/methods/decorators/on_callback_query.py b/pyrogram/client/methods/decorators/on_callback_query.py index bf0a823a..f030f929 100644 --- a/pyrogram/client/methods/decorators/on_callback_query.py +++ b/pyrogram/client/methods/decorators/on_callback_query.py @@ -25,9 +25,11 @@ from ...ext import BaseClient class OnCallbackQuery(BaseClient): - def on_callback_query(self=None, - filters=None, - group: int = 0) -> callable: + def on_callback_query( + self=None, + filters=None, + group: int = 0 + ) -> callable: """Use this decorator to automatically register a function for handling callback queries. This does the same thing as :meth:`add_handler` using the :class:`CallbackQueryHandler`. diff --git a/pyrogram/client/methods/decorators/on_deleted_messages.py b/pyrogram/client/methods/decorators/on_deleted_messages.py index 1b1a602b..b5a95381 100644 --- a/pyrogram/client/methods/decorators/on_deleted_messages.py +++ b/pyrogram/client/methods/decorators/on_deleted_messages.py @@ -25,9 +25,11 @@ from ...ext import BaseClient class OnDeletedMessages(BaseClient): - def on_deleted_messages(self=None, - filters=None, - group: int = 0) -> callable: + def on_deleted_messages( + self=None, + filters=None, + group: int = 0 + ) -> callable: """Use this decorator to automatically register a function for handling deleted messages. This does the same thing as :meth:`add_handler` using the :class:`DeletedMessagesHandler`. diff --git a/pyrogram/client/methods/decorators/on_message.py b/pyrogram/client/methods/decorators/on_message.py index c2f35a19..41eb73e5 100644 --- a/pyrogram/client/methods/decorators/on_message.py +++ b/pyrogram/client/methods/decorators/on_message.py @@ -25,9 +25,11 @@ from ...ext import BaseClient class OnMessage(BaseClient): - def on_message(self=None, - filters=None, - group: int = 0) -> callable: + def on_message( + self=None, + filters=None, + group: int = 0 + ) -> callable: """Use this decorator to automatically register a function for handling messages. This does the same thing as :meth:`add_handler` using the :class:`MessageHandler`. diff --git a/pyrogram/client/methods/decorators/on_raw_update.py b/pyrogram/client/methods/decorators/on_raw_update.py index 2deedb00..a176ab50 100644 --- a/pyrogram/client/methods/decorators/on_raw_update.py +++ b/pyrogram/client/methods/decorators/on_raw_update.py @@ -24,8 +24,10 @@ from ...ext import BaseClient class OnRawUpdate(BaseClient): - def on_raw_update(self=None, - group: int = 0) -> callable: + def on_raw_update( + self=None, + group: int = 0 + ) -> callable: """Use this decorator to automatically register a function for handling raw updates. This does the same thing as :meth:`add_handler` using the :class:`RawUpdateHandler`. diff --git a/pyrogram/client/methods/decorators/on_user_status.py b/pyrogram/client/methods/decorators/on_user_status.py index 6198c9cd..580dc498 100644 --- a/pyrogram/client/methods/decorators/on_user_status.py +++ b/pyrogram/client/methods/decorators/on_user_status.py @@ -25,9 +25,11 @@ from ...ext import BaseClient class OnUserStatus(BaseClient): - def on_user_status(self=None, - filters=None, - group: int = 0) -> callable: + def on_user_status( + self=None, + filters=None, + group: int = 0 + ) -> callable: """Use this decorator to automatically register a function for handling user status updates. This does the same thing as :meth:`add_handler` using the :class:`UserStatusHandler`. diff --git a/pyrogram/client/methods/messages/close_poll.py b/pyrogram/client/methods/messages/close_poll.py index c2d2706b..ac4fc197 100644 --- a/pyrogram/client/methods/messages/close_poll.py +++ b/pyrogram/client/methods/messages/close_poll.py @@ -23,9 +23,11 @@ from pyrogram.client.ext import BaseClient class ClosePoll(BaseClient): - def close_poll(self, - chat_id: Union[int, str], - message_id: id) -> bool: + def close_poll( + self, + chat_id: Union[int, str], + message_id: id + ) -> bool: """Use this method to close (stop) a poll. Closed polls can't be reopened and nobody will be able to vote in it anymore. diff --git a/pyrogram/client/methods/messages/delete_messages.py b/pyrogram/client/methods/messages/delete_messages.py index 06acbb1f..8ea729ff 100644 --- a/pyrogram/client/methods/messages/delete_messages.py +++ b/pyrogram/client/methods/messages/delete_messages.py @@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient class DeleteMessages(BaseClient): - def delete_messages(self, - chat_id: Union[int, str], - message_ids: Iterable[int], - revoke: bool = True) -> bool: + def delete_messages( + self, + chat_id: Union[int, str], + message_ids: Iterable[int], + revoke: bool = True + ) -> bool: """Use this method to delete messages, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago. diff --git a/pyrogram/client/methods/messages/download_media.py b/pyrogram/client/methods/messages/download_media.py index 1c80f63a..29ba7af5 100644 --- a/pyrogram/client/methods/messages/download_media.py +++ b/pyrogram/client/methods/messages/download_media.py @@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient class DownloadMedia(BaseClient): - def download_media(self, - message: Union["pyrogram.Message", str], - file_name: str = "", - block: bool = True, - progress: callable = None, - progress_args: tuple = ()) -> Union[str, None]: + def download_media( + self, + message: Union["pyrogram.Message", str], + file_name: str = "", + block: bool = True, + progress: callable = None, + progress_args: tuple = () + ) -> Union[str, None]: """Use this method to download the media from a Message. Args: diff --git a/pyrogram/client/methods/messages/edit_message_caption.py b/pyrogram/client/methods/messages/edit_message_caption.py index fe704e41..ce393319 100644 --- a/pyrogram/client/methods/messages/edit_message_caption.py +++ b/pyrogram/client/methods/messages/edit_message_caption.py @@ -24,12 +24,14 @@ from pyrogram.client.ext import BaseClient class EditMessageCaption(BaseClient): - def edit_message_caption(self, - chat_id: Union[int, str], - message_id: int, - caption: str, - parse_mode: str = "", - reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": + def edit_message_caption( + self, + chat_id: Union[int, str], + message_id: int, + caption: str, + parse_mode: str = "", + reply_markup: "pyrogram.InlineKeyboardMarkup" = None + ) -> "pyrogram.Message": """Use this method to edit captions of messages. Args: diff --git a/pyrogram/client/methods/messages/edit_message_media.py b/pyrogram/client/methods/messages/edit_message_media.py index 2f82e2ea..cbb00aa3 100644 --- a/pyrogram/client/methods/messages/edit_message_media.py +++ b/pyrogram/client/methods/messages/edit_message_media.py @@ -33,11 +33,13 @@ from pyrogram.client.types.input_media import InputMedia class EditMessageMedia(BaseClient): - def edit_message_media(self, - chat_id: Union[int, str], - message_id: int, - media: InputMedia, - reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": + def edit_message_media( + self, + chat_id: Union[int, str], + message_id: int, + media: InputMedia, + reply_markup: "pyrogram.InlineKeyboardMarkup" = None + ) -> "pyrogram.Message": """Use this method to edit audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, diff --git a/pyrogram/client/methods/messages/edit_message_reply_markup.py b/pyrogram/client/methods/messages/edit_message_reply_markup.py index f8b5c0a5..68455131 100644 --- a/pyrogram/client/methods/messages/edit_message_reply_markup.py +++ b/pyrogram/client/methods/messages/edit_message_reply_markup.py @@ -24,10 +24,12 @@ from pyrogram.client.ext import BaseClient class EditMessageReplyMarkup(BaseClient): - def edit_message_reply_markup(self, - chat_id: Union[int, str], - message_id: int, - reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": + def edit_message_reply_markup( + self, + chat_id: Union[int, str], + message_id: int, + reply_markup: "pyrogram.InlineKeyboardMarkup" = None + ) -> "pyrogram.Message": """Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots). Args: diff --git a/pyrogram/client/methods/messages/edit_message_text.py b/pyrogram/client/methods/messages/edit_message_text.py index 1d2a065b..f4c5f6cf 100644 --- a/pyrogram/client/methods/messages/edit_message_text.py +++ b/pyrogram/client/methods/messages/edit_message_text.py @@ -24,13 +24,15 @@ from pyrogram.client.ext import BaseClient class EditMessageText(BaseClient): - def edit_message_text(self, - chat_id: Union[int, str], - message_id: int, - text: str, - parse_mode: str = "", - disable_web_page_preview: bool = None, - reply_markup: "pyrogram.InlineKeyboardMarkup" = None) -> "pyrogram.Message": + def edit_message_text( + self, + chat_id: Union[int, str], + message_id: int, + text: str, + parse_mode: str = "", + disable_web_page_preview: bool = None, + reply_markup: "pyrogram.InlineKeyboardMarkup" = None + ) -> "pyrogram.Message": """Use this method to edit text messages. Args: diff --git a/pyrogram/client/methods/messages/forward_messages.py b/pyrogram/client/methods/messages/forward_messages.py index 72e43e08..35d406ae 100644 --- a/pyrogram/client/methods/messages/forward_messages.py +++ b/pyrogram/client/methods/messages/forward_messages.py @@ -24,11 +24,13 @@ from ...ext import BaseClient class ForwardMessages(BaseClient): - def forward_messages(self, - chat_id: Union[int, str], - from_chat_id: Union[int, str], - message_ids: Iterable[int], - disable_notification: bool = None) -> "pyrogram.Messages": + def forward_messages( + self, + chat_id: Union[int, str], + from_chat_id: Union[int, str], + message_ids: Iterable[int], + disable_notification: bool = None + ) -> "pyrogram.Messages": """Use this method to forward messages of any kind. Args: diff --git a/pyrogram/client/methods/messages/get_history.py b/pyrogram/client/methods/messages/get_history.py index 73923b44..ca357204 100644 --- a/pyrogram/client/methods/messages/get_history.py +++ b/pyrogram/client/methods/messages/get_history.py @@ -29,13 +29,15 @@ log = logging.getLogger(__name__) class GetHistory(BaseClient): - def get_history(self, - chat_id: Union[int, str], - limit: int = 100, - offset: int = 0, - offset_id: int = 0, - offset_date: int = 0, - reverse: bool = False): + def get_history( + self, + chat_id: Union[int, str], + limit: int = 100, + offset: int = 0, + offset_id: int = 0, + offset_date: int = 0, + reverse: bool = False + ): """Use this method to retrieve a chunk of the history of a chat. You can get up to 100 messages at once. diff --git a/pyrogram/client/methods/messages/get_messages.py b/pyrogram/client/methods/messages/get_messages.py index 40b1b0ee..63fee163 100644 --- a/pyrogram/client/methods/messages/get_messages.py +++ b/pyrogram/client/methods/messages/get_messages.py @@ -29,11 +29,13 @@ log = logging.getLogger(__name__) class GetMessages(BaseClient): - def get_messages(self, - chat_id: Union[int, str], - message_ids: Union[int, Iterable[int]] = None, - reply_to_message_ids: Union[int, Iterable[int]] = None, - replies: int = 1) -> Union["pyrogram.Message", "pyrogram.Messages"]: + def get_messages( + self, + chat_id: Union[int, str], + message_ids: Union[int, Iterable[int]] = None, + reply_to_message_ids: Union[int, Iterable[int]] = None, + replies: int = 1 + ) -> Union["pyrogram.Message", "pyrogram.Messages"]: """Use this method to get one or more messages that belong to a specific chat. You can retrieve up to 200 messages at once. diff --git a/pyrogram/client/methods/messages/iter_history.py b/pyrogram/client/methods/messages/iter_history.py index ab587988..92dc7584 100644 --- a/pyrogram/client/methods/messages/iter_history.py +++ b/pyrogram/client/methods/messages/iter_history.py @@ -23,13 +23,15 @@ from ...ext import BaseClient class IterHistory(BaseClient): - def iter_history(self, - chat_id: Union[int, str], - limit: int = 0, - offset: int = 0, - offset_id: int = 0, - offset_date: int = 0, - reverse: bool = False) -> Generator["pyrogram.Message", None, None]: + def iter_history( + self, + chat_id: Union[int, str], + limit: int = 0, + offset: int = 0, + offset_id: int = 0, + offset_date: int = 0, + reverse: bool = False + ) -> Generator["pyrogram.Message", None, None]: """Use this method to iterate through a chat history sequentially. This convenience method does the same as repeatedly calling :meth:`get_history` in a loop, thus saving you from diff --git a/pyrogram/client/methods/messages/retract_vote.py b/pyrogram/client/methods/messages/retract_vote.py index 7893f768..e7ffe19b 100644 --- a/pyrogram/client/methods/messages/retract_vote.py +++ b/pyrogram/client/methods/messages/retract_vote.py @@ -23,9 +23,11 @@ from pyrogram.client.ext import BaseClient class RetractVote(BaseClient): - def retract_vote(self, - chat_id: Union[int, str], - message_id: id) -> bool: + def retract_vote( + self, + chat_id: Union[int, str], + message_id: id + ) -> bool: """Use this method to retract your vote in a poll. Args: diff --git a/pyrogram/client/methods/messages/send_animation.py b/pyrogram/client/methods/messages/send_animation.py index 5ac902ed..454d25ff 100644 --- a/pyrogram/client/methods/messages/send_animation.py +++ b/pyrogram/client/methods/messages/send_animation.py @@ -28,23 +28,27 @@ from pyrogram.client.ext import BaseClient, utils class SendAnimation(BaseClient): - def send_animation(self, - chat_id: Union[int, str], - animation: str, - caption: str = "", - parse_mode: str = "", - duration: int = 0, - width: int = 0, - height: int = 0, - thumb: str = None, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_animation( + self, + chat_id: Union[int, str], + animation: str, + caption: str = "", + parse_mode: str = "", + duration: int = 0, + width: int = 0, + height: int = 0, + thumb: str = None, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send animation files (animation or H.264/MPEG-4 AVC video without sound). Args: diff --git a/pyrogram/client/methods/messages/send_audio.py b/pyrogram/client/methods/messages/send_audio.py index a4f5512b..d99cf744 100644 --- a/pyrogram/client/methods/messages/send_audio.py +++ b/pyrogram/client/methods/messages/send_audio.py @@ -28,23 +28,27 @@ from pyrogram.client.ext import BaseClient, utils class SendAudio(BaseClient): - def send_audio(self, - chat_id: Union[int, str], - audio: str, - caption: str = "", - parse_mode: str = "", - duration: int = 0, - performer: str = None, - title: str = None, - thumb: str = None, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_audio( + self, + chat_id: Union[int, str], + audio: str, + caption: str = "", + parse_mode: str = "", + duration: int = 0, + performer: str = None, + title: str = None, + thumb: str = None, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send audio files. For sending voice messages, use the :obj:`send_voice()` method instead. diff --git a/pyrogram/client/methods/messages/send_chat_action.py b/pyrogram/client/methods/messages/send_chat_action.py index 479e7abb..bfddf90b 100644 --- a/pyrogram/client/methods/messages/send_chat_action.py +++ b/pyrogram/client/methods/messages/send_chat_action.py @@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient, ChatAction class SendChatAction(BaseClient): - def send_chat_action(self, - chat_id: Union[int, str], - action: Union[ChatAction, str], - progress: int = 0): + def send_chat_action( + self, + chat_id: Union[int, str], + action: Union[ChatAction, str], + progress: int = 0 + ): """Use this method when you need to tell the other party that something is happening on your side. Args: diff --git a/pyrogram/client/methods/messages/send_contact.py b/pyrogram/client/methods/messages/send_contact.py index 96b23a9b..bed9a37e 100644 --- a/pyrogram/client/methods/messages/send_contact.py +++ b/pyrogram/client/methods/messages/send_contact.py @@ -24,18 +24,22 @@ from pyrogram.client.ext import BaseClient class SendContact(BaseClient): - def send_contact(self, - chat_id: Union[int, str], - phone_number: str, - first_name: str, - last_name: str = "", - vcard: str = "", - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None) -> "pyrogram.Message": + def send_contact( + self, + chat_id: Union[int, str], + phone_number: str, + first_name: str, + last_name: str = "", + vcard: str = "", + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None + ) -> "pyrogram.Message": """Use this method to send phone contacts. Args: diff --git a/pyrogram/client/methods/messages/send_document.py b/pyrogram/client/methods/messages/send_document.py index 6dc496e4..2693697a 100644 --- a/pyrogram/client/methods/messages/send_document.py +++ b/pyrogram/client/methods/messages/send_document.py @@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils class SendDocument(BaseClient): - def send_document(self, - chat_id: Union[int, str], - document: str, - thumb: str = None, - caption: str = "", - parse_mode: str = "", - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_document( + self, + chat_id: Union[int, str], + document: str, + thumb: str = None, + caption: str = "", + parse_mode: str = "", + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send general files. Args: diff --git a/pyrogram/client/methods/messages/send_location.py b/pyrogram/client/methods/messages/send_location.py index 5fe57904..c59ea380 100644 --- a/pyrogram/client/methods/messages/send_location.py +++ b/pyrogram/client/methods/messages/send_location.py @@ -24,16 +24,20 @@ from pyrogram.client.ext import BaseClient class SendLocation(BaseClient): - def send_location(self, - chat_id: Union[int, str], - latitude: float, - longitude: float, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None) -> "pyrogram.Message": + def send_location( + self, + chat_id: Union[int, str], + latitude: float, + longitude: float, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None + ) -> "pyrogram.Message": """Use this method to send points on the map. Args: diff --git a/pyrogram/client/methods/messages/send_media_group.py b/pyrogram/client/methods/messages/send_media_group.py index 42e4ddde..aff0a29f 100644 --- a/pyrogram/client/methods/messages/send_media_group.py +++ b/pyrogram/client/methods/messages/send_media_group.py @@ -34,11 +34,13 @@ log = logging.getLogger(__name__) class SendMediaGroup(BaseClient): # TODO: Add progress parameter # TODO: Figure out how to send albums using URLs - def send_media_group(self, - chat_id: Union[int, str], - media: List[Union["pyrogram.InputMediaPhoto", "pyrogram.InputMediaVideo"]], - disable_notification: bool = None, - reply_to_message_id: int = None): + def send_media_group( + self, + chat_id: Union[int, str], + media: List[Union["pyrogram.InputMediaPhoto", "pyrogram.InputMediaVideo"]], + disable_notification: bool = None, + reply_to_message_id: int = None + ): """Use this method to send a group of photos or videos as an album. Args: diff --git a/pyrogram/client/methods/messages/send_message.py b/pyrogram/client/methods/messages/send_message.py index 6589fcd6..3913e97d 100644 --- a/pyrogram/client/methods/messages/send_message.py +++ b/pyrogram/client/methods/messages/send_message.py @@ -24,17 +24,21 @@ from ...ext import BaseClient class SendMessage(BaseClient): - def send_message(self, - chat_id: Union[int, str], - text: str, - parse_mode: str = "", - disable_web_page_preview: bool = None, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None) -> "pyrogram.Message": + def send_message( + self, + chat_id: Union[int, str], + text: str, + parse_mode: str = "", + disable_web_page_preview: bool = None, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None + ) -> "pyrogram.Message": """Use this method to send text messages. Args: diff --git a/pyrogram/client/methods/messages/send_photo.py b/pyrogram/client/methods/messages/send_photo.py index 84647245..6892f92d 100644 --- a/pyrogram/client/methods/messages/send_photo.py +++ b/pyrogram/client/methods/messages/send_photo.py @@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils class SendPhoto(BaseClient): - def send_photo(self, - chat_id: Union[int, str], - photo: str, - caption: str = "", - parse_mode: str = "", - ttl_seconds: int = None, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_photo( + self, + chat_id: Union[int, str], + photo: str, + caption: str = "", + parse_mode: str = "", + ttl_seconds: int = None, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send photos. Args: diff --git a/pyrogram/client/methods/messages/send_poll.py b/pyrogram/client/methods/messages/send_poll.py index 8e938a1a..423f962d 100644 --- a/pyrogram/client/methods/messages/send_poll.py +++ b/pyrogram/client/methods/messages/send_poll.py @@ -24,16 +24,20 @@ from pyrogram.client.ext import BaseClient class SendPoll(BaseClient): - def send_poll(self, - chat_id: Union[int, str], - question: str, - options: List[str], - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None) -> "pyrogram.Message": + def send_poll \ + (self, + chat_id: Union[int, str], + question: str, + options: List[str], + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None + ) -> "pyrogram.Message": """Use this method to send a new poll. Args: diff --git a/pyrogram/client/methods/messages/send_sticker.py b/pyrogram/client/methods/messages/send_sticker.py index ba16a2e7..b4441cb1 100644 --- a/pyrogram/client/methods/messages/send_sticker.py +++ b/pyrogram/client/methods/messages/send_sticker.py @@ -28,17 +28,21 @@ from pyrogram.client.ext import BaseClient, utils class SendSticker(BaseClient): - def send_sticker(self, - chat_id: Union[int, str], - sticker: str, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_sticker( + self, + chat_id: Union[int, str], + sticker: str, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send .webp stickers. Args: diff --git a/pyrogram/client/methods/messages/send_venue.py b/pyrogram/client/methods/messages/send_venue.py index 163be38e..cc98eb28 100644 --- a/pyrogram/client/methods/messages/send_venue.py +++ b/pyrogram/client/methods/messages/send_venue.py @@ -24,20 +24,24 @@ from pyrogram.client.ext import BaseClient class SendVenue(BaseClient): - def send_venue(self, - chat_id: Union[int, str], - latitude: float, - longitude: float, - title: str, - address: str, - foursquare_id: str = "", - foursquare_type: str = "", - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None) -> "pyrogram.Message": + def send_venue( + self, + chat_id: Union[int, str], + latitude: float, + longitude: float, + title: str, + address: str, + foursquare_id: str = "", + foursquare_type: str = "", + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None + ) -> "pyrogram.Message": """Use this method to send information about a venue. Args: diff --git a/pyrogram/client/methods/messages/send_video.py b/pyrogram/client/methods/messages/send_video.py index 0224eaf6..bb90bdf6 100644 --- a/pyrogram/client/methods/messages/send_video.py +++ b/pyrogram/client/methods/messages/send_video.py @@ -28,24 +28,28 @@ from pyrogram.client.ext import BaseClient, utils class SendVideo(BaseClient): - def send_video(self, - chat_id: Union[int, str], - video: str, - caption: str = "", - parse_mode: str = "", - duration: int = 0, - width: int = 0, - height: int = 0, - thumb: str = None, - supports_streaming: bool = True, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_video( + self, + chat_id: Union[int, str], + video: str, + caption: str = "", + parse_mode: str = "", + duration: int = 0, + width: int = 0, + height: int = 0, + thumb: str = None, + supports_streaming: bool = True, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send video files. Args: diff --git a/pyrogram/client/methods/messages/send_video_note.py b/pyrogram/client/methods/messages/send_video_note.py index b35dbea6..349b76a6 100644 --- a/pyrogram/client/methods/messages/send_video_note.py +++ b/pyrogram/client/methods/messages/send_video_note.py @@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils class SendVideoNote(BaseClient): - def send_video_note(self, - chat_id: Union[int, str], - video_note: str, - duration: int = 0, - length: int = 1, - thumb: str = None, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_video_note( + self, + chat_id: Union[int, str], + video_note: str, + duration: int = 0, + length: int = 1, + thumb: str = None, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send video messages. Args: diff --git a/pyrogram/client/methods/messages/send_voice.py b/pyrogram/client/methods/messages/send_voice.py index 33261db6..10b3c906 100644 --- a/pyrogram/client/methods/messages/send_voice.py +++ b/pyrogram/client/methods/messages/send_voice.py @@ -28,20 +28,24 @@ from pyrogram.client.ext import BaseClient, utils class SendVoice(BaseClient): - def send_voice(self, - chat_id: Union[int, str], - voice: str, - caption: str = "", - parse_mode: str = "", - duration: int = 0, - disable_notification: bool = None, - reply_to_message_id: int = None, - reply_markup: Union["pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply"] = None, - progress: callable = None, - progress_args: tuple = ()) -> Union["pyrogram.Message", None]: + def send_voice( + self, + chat_id: Union[int, str], + voice: str, + caption: str = "", + parse_mode: str = "", + duration: int = 0, + disable_notification: bool = None, + reply_to_message_id: int = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None, + progress: callable = None, + progress_args: tuple = () + ) -> Union["pyrogram.Message", None]: """Use this method to send audio files. Args: diff --git a/pyrogram/client/methods/messages/vote_poll.py b/pyrogram/client/methods/messages/vote_poll.py index 9e400e62..bf44c831 100644 --- a/pyrogram/client/methods/messages/vote_poll.py +++ b/pyrogram/client/methods/messages/vote_poll.py @@ -23,10 +23,12 @@ from pyrogram.client.ext import BaseClient class VotePoll(BaseClient): - def vote_poll(self, - chat_id: Union[int, str], - message_id: id, - option: int) -> bool: + def vote_poll( + self, + chat_id: Union[int, str], + message_id: id, + option: int + ) -> bool: """Use this method to vote a poll. Args: diff --git a/pyrogram/client/methods/password/change_cloud_password.py b/pyrogram/client/methods/password/change_cloud_password.py index 3504dab1..163144bf 100644 --- a/pyrogram/client/methods/password/change_cloud_password.py +++ b/pyrogram/client/methods/password/change_cloud_password.py @@ -24,10 +24,12 @@ from ...ext import BaseClient class ChangeCloudPassword(BaseClient): - def change_cloud_password(self, - current_password: str, - new_password: str, - new_hint: str = "") -> bool: + def change_cloud_password( + self, + current_password: str, + new_password: str, + new_hint: str = "" + ) -> bool: """Use this method to change your Two-Step Verification password (Cloud Password) with a new one. Args: diff --git a/pyrogram/client/methods/password/enable_cloud_password.py b/pyrogram/client/methods/password/enable_cloud_password.py index 980f50fd..6e7a0bc9 100644 --- a/pyrogram/client/methods/password/enable_cloud_password.py +++ b/pyrogram/client/methods/password/enable_cloud_password.py @@ -24,10 +24,12 @@ from ...ext import BaseClient class EnableCloudPassword(BaseClient): - def enable_cloud_password(self, - password: str, - hint: str = "", - email: str = None) -> bool: + def enable_cloud_password( + self, + password: str, + hint: str = "", + email: str = None + ) -> bool: """Use this method to enable the Two-Step Verification security feature (Cloud Password) on your account. This password will be asked when you log-in on a new device in addition to the SMS code. diff --git a/pyrogram/client/methods/password/remove_cloud_password.py b/pyrogram/client/methods/password/remove_cloud_password.py index 6817ab12..e7c7ed2d 100644 --- a/pyrogram/client/methods/password/remove_cloud_password.py +++ b/pyrogram/client/methods/password/remove_cloud_password.py @@ -22,8 +22,10 @@ from ...ext import BaseClient class RemoveCloudPassword(BaseClient): - def remove_cloud_password(self, - password: str) -> bool: + def remove_cloud_password( + self, + password: str + ) -> bool: """Use this method to turn off the Two-Step Verification security feature (Cloud Password) on your account. Args: diff --git a/pyrogram/client/methods/users/delete_user_profile_photos.py b/pyrogram/client/methods/users/delete_user_profile_photos.py index 025a5e95..84c68dd4 100644 --- a/pyrogram/client/methods/users/delete_user_profile_photos.py +++ b/pyrogram/client/methods/users/delete_user_profile_photos.py @@ -25,8 +25,10 @@ from ...ext import BaseClient class DeleteUserProfilePhotos(BaseClient): - def delete_user_profile_photos(self, - id: Union[str, List[str]]) -> bool: + def delete_user_profile_photos( + self, + id: Union[str, List[str]] + ) -> bool: """Use this method to delete your own profile photos Args: diff --git a/pyrogram/client/methods/users/get_user_profile_photos.py b/pyrogram/client/methods/users/get_user_profile_photos.py index 2129dba3..d23ec48d 100644 --- a/pyrogram/client/methods/users/get_user_profile_photos.py +++ b/pyrogram/client/methods/users/get_user_profile_photos.py @@ -24,10 +24,12 @@ from ...ext import BaseClient class GetUserProfilePhotos(BaseClient): - def get_user_profile_photos(self, - user_id: Union[int, str], - offset: int = 0, - limit: int = 100) -> "pyrogram.UserProfilePhotos": + def get_user_profile_photos( + self, + user_id: Union[int, str], + offset: int = 0, + limit: int = 100 + ) -> "pyrogram.UserProfilePhotos": """Use this method to get a list of profile pictures for a user. Args: diff --git a/pyrogram/client/methods/users/get_users.py b/pyrogram/client/methods/users/get_users.py index 6c340ffa..d3822dc9 100644 --- a/pyrogram/client/methods/users/get_users.py +++ b/pyrogram/client/methods/users/get_users.py @@ -24,8 +24,10 @@ from ...ext import BaseClient class GetUsers(BaseClient): - def get_users(self, - user_ids: Iterable[Union[int, str]]) -> Union["pyrogram.User", List["pyrogram.User"]]: + def get_users( + self, + user_ids: Iterable[Union[int, str]] + ) -> Union["pyrogram.User", List["pyrogram.User"]]: """Use this method to get information about a user. You can retrieve up to 200 users at once. diff --git a/pyrogram/client/methods/users/set_user_profile_photo.py b/pyrogram/client/methods/users/set_user_profile_photo.py index 359a0cd0..705631fd 100644 --- a/pyrogram/client/methods/users/set_user_profile_photo.py +++ b/pyrogram/client/methods/users/set_user_profile_photo.py @@ -21,8 +21,10 @@ from ...ext import BaseClient class SetUserProfilePhoto(BaseClient): - def set_user_profile_photo(self, - photo: str) -> bool: + def set_user_profile_photo( + self, + photo: str + ) -> bool: """Use this method to set a new profile photo. This method only works for Users. diff --git a/pyrogram/client/methods/users/update_username.py b/pyrogram/client/methods/users/update_username.py index 9a4feb23..5fd1a711 100644 --- a/pyrogram/client/methods/users/update_username.py +++ b/pyrogram/client/methods/users/update_username.py @@ -23,8 +23,10 @@ from ...ext import BaseClient class UpdateUsername(BaseClient): - def update_username(self, - username: Union[str, None]) -> bool: + def update_username( + self, + username: Union[str, None] + ) -> bool: """Use this method to update your own username. This method only works for users, not bots. Bot usernames must be changed via Bot Support or by recreating diff --git a/pyrogram/client/types/bots/callback_query.py b/pyrogram/client/types/bots/callback_query.py index a7a9ad53..4497747e 100644 --- a/pyrogram/client/types/bots/callback_query.py +++ b/pyrogram/client/types/bots/callback_query.py @@ -61,16 +61,16 @@ class CallbackQuery(PyrogramType, Update): __slots__ = ["id", "from_user", "chat_instance", "message", "inline_message_id", "data", "game_short_name"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - id: str, - from_user: User, - chat_instance: str, - message: "pyrogram.Message" = None, - inline_message_id: str = None, - data: bytes = None, - game_short_name: str = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + id: str, + from_user: User, + chat_instance: str, + message: "pyrogram.Message" = None, + inline_message_id: str = None, + data: bytes = None, + game_short_name: str = None ): super().__init__(client) diff --git a/pyrogram/client/types/bots/force_reply.py b/pyrogram/client/types/bots/force_reply.py index 7838ee88..fca2c061 100644 --- a/pyrogram/client/types/bots/force_reply.py +++ b/pyrogram/client/types/bots/force_reply.py @@ -36,8 +36,8 @@ class ForceReply(PyrogramType): __slots__ = ["selective"] def __init__( - self, - selective: bool = None + self, + selective: bool = None ): super().__init__(None) diff --git a/pyrogram/client/types/bots/game_high_score.py b/pyrogram/client/types/bots/game_high_score.py index 4fc3c6f8..da6b2881 100644 --- a/pyrogram/client/types/bots/game_high_score.py +++ b/pyrogram/client/types/bots/game_high_score.py @@ -40,12 +40,12 @@ class GameHighScore(PyrogramType): __slots__ = ["user", "score", "position"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - user: User, - score: int, - position: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + user: User, + score: int, + position: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/bots/game_high_scores.py b/pyrogram/client/types/bots/game_high_scores.py index 25e4af5d..3c197969 100644 --- a/pyrogram/client/types/bots/game_high_scores.py +++ b/pyrogram/client/types/bots/game_high_scores.py @@ -38,11 +38,11 @@ class GameHighScores(PyrogramType): __slots__ = ["total_count", "game_high_scores"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - total_count: int, - game_high_scores: List[GameHighScore] + self, + *, + client: "pyrogram.client.ext.BaseClient", + total_count: int, + game_high_scores: List[GameHighScore] ): super().__init__(client) diff --git a/pyrogram/client/types/bots/inline_keyboard_button.py b/pyrogram/client/types/bots/inline_keyboard_button.py index cca42b33..ff6f3cdb 100644 --- a/pyrogram/client/types/bots/inline_keyboard_button.py +++ b/pyrogram/client/types/bots/inline_keyboard_button.py @@ -59,13 +59,13 @@ class InlineKeyboardButton(PyrogramType): ] def __init__( - self, - text: str, - callback_data: bytes = None, - url: str = None, - switch_inline_query: str = None, - switch_inline_query_current_chat: str = None, - callback_game: CallbackGame = None + self, + text: str, + callback_data: bytes = None, + url: str = None, + switch_inline_query: str = None, + switch_inline_query_current_chat: str = None, + callback_game: CallbackGame = None ): super().__init__(None) diff --git a/pyrogram/client/types/bots/inline_keyboard_markup.py b/pyrogram/client/types/bots/inline_keyboard_markup.py index 77e9cfeb..54476c5e 100644 --- a/pyrogram/client/types/bots/inline_keyboard_markup.py +++ b/pyrogram/client/types/bots/inline_keyboard_markup.py @@ -34,8 +34,8 @@ class InlineKeyboardMarkup(PyrogramType): __slots__ = ["inline_keyboard"] def __init__( - self, - inline_keyboard: List[List[InlineKeyboardButton]] + self, + inline_keyboard: List[List[InlineKeyboardButton]] ): super().__init__(None) diff --git a/pyrogram/client/types/bots/keyboard_button.py b/pyrogram/client/types/bots/keyboard_button.py index b8786cee..477442cc 100644 --- a/pyrogram/client/types/bots/keyboard_button.py +++ b/pyrogram/client/types/bots/keyboard_button.py @@ -43,10 +43,10 @@ class KeyboardButton(PyrogramType): __slots__ = ["text", "request_contact", "request_location"] def __init__( - self, - text: str, - request_contact: bool = None, - request_location: bool = None + self, + text: str, + request_contact: bool = None, + request_location: bool = None ): super().__init__(None) diff --git a/pyrogram/client/types/bots/reply_keyboard_markup.py b/pyrogram/client/types/bots/reply_keyboard_markup.py index 431a55eb..b0216803 100644 --- a/pyrogram/client/types/bots/reply_keyboard_markup.py +++ b/pyrogram/client/types/bots/reply_keyboard_markup.py @@ -52,11 +52,11 @@ class ReplyKeyboardMarkup(PyrogramType): __slots__ = ["keyboard", "resize_keyboard", "one_time_keyboard", "selective"] def __init__( - self, - keyboard: List[List[Union[KeyboardButton, str]]], - resize_keyboard: bool = None, - one_time_keyboard: bool = None, - selective: bool = None + self, + keyboard: List[List[Union[KeyboardButton, str]]], + resize_keyboard: bool = None, + one_time_keyboard: bool = None, + selective: bool = None ): super().__init__(None) diff --git a/pyrogram/client/types/bots/reply_keyboard_remove.py b/pyrogram/client/types/bots/reply_keyboard_remove.py index 2fb5fe19..3298ab6f 100644 --- a/pyrogram/client/types/bots/reply_keyboard_remove.py +++ b/pyrogram/client/types/bots/reply_keyboard_remove.py @@ -38,8 +38,8 @@ class ReplyKeyboardRemove(PyrogramType): __slots__ = ["selective"] def __init__( - self, - selective: bool = None + self, + selective: bool = None ): super().__init__(None) diff --git a/pyrogram/client/types/input_media/input_media.py b/pyrogram/client/types/input_media/input_media.py index 677d4918..aeeef350 100644 --- a/pyrogram/client/types/input_media/input_media.py +++ b/pyrogram/client/types/input_media/input_media.py @@ -21,10 +21,10 @@ class InputMedia: __slots__ = ["media", "caption", "parse_mode"] def __init__( - self, - media: str, - caption: str, - parse_mode: str + self, + media: str, + caption: str, + parse_mode: str ): self.media = media self.caption = caption diff --git a/pyrogram/client/types/input_media/input_media_animation.py b/pyrogram/client/types/input_media/input_media_animation.py index 20debb19..e77499b5 100644 --- a/pyrogram/client/types/input_media/input_media_animation.py +++ b/pyrogram/client/types/input_media/input_media_animation.py @@ -55,14 +55,14 @@ class InputMediaAnimation(InputMedia): __slots__ = ["thumb", "width", "height", "duration"] def __init__( - self, - media: str, - thumb: str = None, - caption: str = "", - parse_mode: str = "", - width: int = 0, - height: int = 0, - duration: int = 0 + self, + media: str, + thumb: str = None, + caption: str = "", + parse_mode: str = "", + width: int = 0, + height: int = 0, + duration: int = 0 ): super().__init__(media, caption, parse_mode) diff --git a/pyrogram/client/types/input_media/input_media_audio.py b/pyrogram/client/types/input_media/input_media_audio.py index 2709a409..e8f1c257 100644 --- a/pyrogram/client/types/input_media/input_media_audio.py +++ b/pyrogram/client/types/input_media/input_media_audio.py @@ -56,14 +56,14 @@ class InputMediaAudio(InputMedia): __slots__ = ["thumb", "duration", "performer", "title"] def __init__( - self, - media: str, - thumb: str = None, - caption: str = "", - parse_mode: str = "", - duration: int = 0, - performer: int = "", - title: str = "" + self, + media: str, + thumb: str = None, + caption: str = "", + parse_mode: str = "", + duration: int = 0, + performer: int = "", + title: str = "" ): super().__init__(media, caption, parse_mode) diff --git a/pyrogram/client/types/input_media/input_media_document.py b/pyrogram/client/types/input_media/input_media_document.py index 2c0c628d..9391e7d8 100644 --- a/pyrogram/client/types/input_media/input_media_document.py +++ b/pyrogram/client/types/input_media/input_media_document.py @@ -46,11 +46,11 @@ class InputMediaDocument(InputMedia): __slots__ = ["thumb"] def __init__( - self, - media: str, - thumb: str = None, - caption: str = "", - parse_mode: str = "" + self, + media: str, + thumb: str = None, + caption: str = "", + parse_mode: str = "" ): super().__init__(media, caption, parse_mode) diff --git a/pyrogram/client/types/input_media/input_media_photo.py b/pyrogram/client/types/input_media/input_media_photo.py index 5618b843..e6bba03b 100644 --- a/pyrogram/client/types/input_media/input_media_photo.py +++ b/pyrogram/client/types/input_media/input_media_photo.py @@ -42,9 +42,9 @@ class InputMediaPhoto(InputMedia): __slots__ = [] def __init__( - self, - media: str, - caption: str = "", - parse_mode: str = "" + self, + media: str, + caption: str = "", + parse_mode: str = "" ): super().__init__(media, caption, parse_mode) diff --git a/pyrogram/client/types/input_media/input_media_video.py b/pyrogram/client/types/input_media/input_media_video.py index b55a9438..5c918f13 100644 --- a/pyrogram/client/types/input_media/input_media_video.py +++ b/pyrogram/client/types/input_media/input_media_video.py @@ -60,15 +60,15 @@ class InputMediaVideo(InputMedia): __slots__ = ["thumb", "width", "height", "duration", "supports_streaming"] def __init__( - self, - media: str, - thumb: str = None, - caption: str = "", - parse_mode: str = "", - width: int = 0, - height: int = 0, - duration: int = 0, - supports_streaming: bool = True + self, + media: str, + thumb: str = None, + caption: str = "", + parse_mode: str = "", + width: int = 0, + height: int = 0, + duration: int = 0, + supports_streaming: bool = True ): super().__init__(media, caption, parse_mode) diff --git a/pyrogram/client/types/input_media/input_phone_contact.py b/pyrogram/client/types/input_media/input_phone_contact.py index 340b335f..4fe7ee60 100644 --- a/pyrogram/client/types/input_media/input_phone_contact.py +++ b/pyrogram/client/types/input_media/input_phone_contact.py @@ -38,10 +38,10 @@ class InputPhoneContact: __slots__ = [] def __init__( - self, - phone: str, - first_name: str, - last_name: str = "" + self, + phone: str, + first_name: str, + last_name: str = "" ): pass diff --git a/pyrogram/client/types/messages_and_media/animation.py b/pyrogram/client/types/messages_and_media/animation.py index 978c88c9..21a01e0f 100644 --- a/pyrogram/client/types/messages_and_media/animation.py +++ b/pyrogram/client/types/messages_and_media/animation.py @@ -60,18 +60,18 @@ class Animation(PyrogramType): __slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "width", "height", "duration"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - width: int, - height: int, - duration: int, - thumb: PhotoSize = None, - file_name: str = None, - mime_type: str = None, - file_size: int = None, - date: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + width: int, + height: int, + duration: int, + thumb: PhotoSize = None, + file_name: str = None, + mime_type: str = None, + file_size: int = None, + date: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/audio.py b/pyrogram/client/types/messages_and_media/audio.py index 334e022e..db49f2eb 100644 --- a/pyrogram/client/types/messages_and_media/audio.py +++ b/pyrogram/client/types/messages_and_media/audio.py @@ -60,18 +60,18 @@ class Audio(PyrogramType): __slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "duration", "performer", "title"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - duration: int, - thumb: PhotoSize = None, - file_name: str = None, - mime_type: str = None, - file_size: int = None, - date: int = None, - performer: str = None, - title: str = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + duration: int, + thumb: PhotoSize = None, + file_name: str = None, + mime_type: str = None, + file_size: int = None, + date: int = None, + performer: str = None, + title: str = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/contact.py b/pyrogram/client/types/messages_and_media/contact.py index 0a897c05..5abe5319 100644 --- a/pyrogram/client/types/messages_and_media/contact.py +++ b/pyrogram/client/types/messages_and_media/contact.py @@ -45,14 +45,14 @@ class Contact(PyrogramType): __slots__ = ["phone_number", "first_name", "last_name", "user_id", "vcard"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - phone_number: str, - first_name: str, - last_name: str = None, - user_id: int = None, - vcard: str = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + phone_number: str, + first_name: str, + last_name: str = None, + user_id: int = None, + vcard: str = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/document.py b/pyrogram/client/types/messages_and_media/document.py index b3f5b586..f3ccc4f8 100644 --- a/pyrogram/client/types/messages_and_media/document.py +++ b/pyrogram/client/types/messages_and_media/document.py @@ -51,15 +51,15 @@ class Document(PyrogramType): __slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - thumb: PhotoSize = None, - file_name: str = None, - mime_type: str = None, - file_size: int = None, - date: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + thumb: PhotoSize = None, + file_name: str = None, + mime_type: str = None, + file_size: int = None, + date: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/game.py b/pyrogram/client/types/messages_and_media/game.py index ddfa84af..cf0b4fa6 100644 --- a/pyrogram/client/types/messages_and_media/game.py +++ b/pyrogram/client/types/messages_and_media/game.py @@ -51,15 +51,15 @@ class Game(PyrogramType): __slots__ = ["id", "title", "short_name", "description", "photo", "animation"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - id: int, - title: str, - short_name: str, - description: str, - photo: Photo, - animation: Animation = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + id: int, + title: str, + short_name: str, + description: str, + photo: Photo, + animation: Animation = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/location.py b/pyrogram/client/types/messages_and_media/location.py index 0d2e6c43..3a7f6d38 100644 --- a/pyrogram/client/types/messages_and_media/location.py +++ b/pyrogram/client/types/messages_and_media/location.py @@ -36,11 +36,11 @@ class Location(PyrogramType): __slots__ = ["longitude", "latitude"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - longitude: float, - latitude: float + self, + *, + client: "pyrogram.client.ext.BaseClient", + longitude: float, + latitude: float ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/message.py b/pyrogram/client/types/messages_and_media/message.py index 405c26d9..9a4e4314 100644 --- a/pyrogram/client/types/messages_and_media/message.py +++ b/pyrogram/client/types/messages_and_media/message.py @@ -246,67 +246,67 @@ class Message(PyrogramType, Update): ] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - message_id: int, - date: int = None, - chat: Chat = None, - from_user: User = None, - forward_from: User = None, - forward_from_chat: Chat = None, - forward_from_message_id: int = None, - forward_signature: str = None, - forward_date: int = None, - reply_to_message: "Message" = None, - mentioned: bool = None, - empty: bool = None, - service: bool = None, - media: bool = None, - edit_date: int = None, - media_group_id: str = None, - author_signature: str = None, - text: str = None, - entities: List["pyrogram.MessageEntity"] = None, - caption_entities: List["pyrogram.MessageEntity"] = None, - audio: "pyrogram.Audio" = None, - document: "pyrogram.Document" = None, - photo: "pyrogram.Photo" = None, - sticker: "pyrogram.Sticker" = None, - animation: "pyrogram.Animation" = None, - game: "pyrogram.Game" = None, - video: "pyrogram.Video" = None, - voice: "pyrogram.Voice" = None, - video_note: "pyrogram.VideoNote" = None, - caption: str = None, - contact: "pyrogram.Contact" = None, - location: "pyrogram.Location" = None, - venue: "pyrogram.Venue" = None, - web_page: bool = None, - poll: "pyrogram.Poll" = None, - new_chat_members: List[User] = None, - left_chat_member: User = None, - new_chat_title: str = None, - new_chat_photo: "pyrogram.Photo" = None, - delete_chat_photo: bool = None, - group_chat_created: bool = None, - supergroup_chat_created: bool = None, - channel_chat_created: bool = None, - migrate_to_chat_id: int = None, - migrate_from_chat_id: int = None, - pinned_message: "Message" = None, - game_high_score: int = None, - views: int = None, - via_bot: User = None, - outgoing: bool = None, - matches: List[Match] = None, - command: List[str] = None, - reply_markup: Union[ - "pyrogram.InlineKeyboardMarkup", - "pyrogram.ReplyKeyboardMarkup", - "pyrogram.ReplyKeyboardRemove", - "pyrogram.ForceReply" - ] = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + message_id: int, + date: int = None, + chat: Chat = None, + from_user: User = None, + forward_from: User = None, + forward_from_chat: Chat = None, + forward_from_message_id: int = None, + forward_signature: str = None, + forward_date: int = None, + reply_to_message: "Message" = None, + mentioned: bool = None, + empty: bool = None, + service: bool = None, + media: bool = None, + edit_date: int = None, + media_group_id: str = None, + author_signature: str = None, + text: str = None, + entities: List["pyrogram.MessageEntity"] = None, + caption_entities: List["pyrogram.MessageEntity"] = None, + audio: "pyrogram.Audio" = None, + document: "pyrogram.Document" = None, + photo: "pyrogram.Photo" = None, + sticker: "pyrogram.Sticker" = None, + animation: "pyrogram.Animation" = None, + game: "pyrogram.Game" = None, + video: "pyrogram.Video" = None, + voice: "pyrogram.Voice" = None, + video_note: "pyrogram.VideoNote" = None, + caption: str = None, + contact: "pyrogram.Contact" = None, + location: "pyrogram.Location" = None, + venue: "pyrogram.Venue" = None, + web_page: bool = None, + poll: "pyrogram.Poll" = None, + new_chat_members: List[User] = None, + left_chat_member: User = None, + new_chat_title: str = None, + new_chat_photo: "pyrogram.Photo" = None, + delete_chat_photo: bool = None, + group_chat_created: bool = None, + supergroup_chat_created: bool = None, + channel_chat_created: bool = None, + migrate_to_chat_id: int = None, + migrate_from_chat_id: int = None, + pinned_message: "Message" = None, + game_high_score: int = None, + views: int = None, + via_bot: User = None, + outgoing: bool = None, + matches: List[Match] = None, + command: List[str] = None, + reply_markup: Union[ + "pyrogram.InlineKeyboardMarkup", + "pyrogram.ReplyKeyboardMarkup", + "pyrogram.ReplyKeyboardRemove", + "pyrogram.ForceReply" + ] = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/message_entity.py b/pyrogram/client/types/messages_and_media/message_entity.py index fa59a5bc..160d0d1e 100644 --- a/pyrogram/client/types/messages_and_media/message_entity.py +++ b/pyrogram/client/types/messages_and_media/message_entity.py @@ -66,14 +66,14 @@ class MessageEntity(PyrogramType): } def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - type: str, - offset: int, - length: int, - url: str = None, - user: User = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + type: str, + offset: int, + length: int, + url: str = None, + user: User = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/messages.py b/pyrogram/client/types/messages_and_media/messages.py index 4a203a4e..9983a01d 100644 --- a/pyrogram/client/types/messages_and_media/messages.py +++ b/pyrogram/client/types/messages_and_media/messages.py @@ -40,11 +40,11 @@ class Messages(PyrogramType, Update): __slots__ = ["total_count", "messages"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - total_count: int, - messages: List[Message] + self, + *, + client: "pyrogram.client.ext.BaseClient", + total_count: int, + messages: List[Message] ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/photo.py b/pyrogram/client/types/messages_and_media/photo.py index 12be919c..6f1852fb 100644 --- a/pyrogram/client/types/messages_and_media/photo.py +++ b/pyrogram/client/types/messages_and_media/photo.py @@ -44,12 +44,12 @@ class Photo(PyrogramType): __slots__ = ["id", "date", "sizes"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - id: str, - date: int, - sizes: List[PhotoSize] + self, + *, + client: "pyrogram.client.ext.BaseClient", + id: str, + date: int, + sizes: List[PhotoSize] ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/photo_size.py b/pyrogram/client/types/messages_and_media/photo_size.py index 03569062..10d00a86 100644 --- a/pyrogram/client/types/messages_and_media/photo_size.py +++ b/pyrogram/client/types/messages_and_media/photo_size.py @@ -45,13 +45,13 @@ class PhotoSize(PyrogramType): __slots__ = ["file_id", "width", "height", "file_size"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - width: int, - height: int, - file_size: int + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + width: int, + height: int, + file_size: int ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/poll.py b/pyrogram/client/types/messages_and_media/poll.py index fa6372d9..68667334 100644 --- a/pyrogram/client/types/messages_and_media/poll.py +++ b/pyrogram/client/types/messages_and_media/poll.py @@ -50,15 +50,15 @@ class Poll(PyrogramType): __slots__ = ["id", "closed", "question", "options", "total_voters", "option_chosen"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - id: int, - closed: bool, - question: str, - options: List[PollOption], - total_voters: int, - option_chosen: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + id: int, + closed: bool, + question: str, + options: List[PollOption], + total_voters: int, + option_chosen: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/poll_option.py b/pyrogram/client/types/messages_and_media/poll_option.py index 1c2d6f1b..a2be866e 100644 --- a/pyrogram/client/types/messages_and_media/poll_option.py +++ b/pyrogram/client/types/messages_and_media/poll_option.py @@ -37,12 +37,12 @@ class PollOption(PyrogramType): __slots__ = ["text", "voters", "data"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - text: str, - voters: int, - data: bytes + self, + *, + client: "pyrogram.client.ext.BaseClient", + text: str, + voters: int, + data: bytes ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/sticker.py b/pyrogram/client/types/messages_and_media/sticker.py index ce390b1d..43fb6e98 100644 --- a/pyrogram/client/types/messages_and_media/sticker.py +++ b/pyrogram/client/types/messages_and_media/sticker.py @@ -69,19 +69,19 @@ class Sticker(PyrogramType): ] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - width: int, - height: int, - thumb: PhotoSize = None, - file_name: str = None, - mime_type: str = None, - file_size: int = None, - date: int = None, - emoji: str = None, - set_name: str = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + width: int, + height: int, + thumb: PhotoSize = None, + file_name: str = None, + mime_type: str = None, + file_size: int = None, + date: int = None, + emoji: str = None, + set_name: str = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/user_profile_photos.py b/pyrogram/client/types/messages_and_media/user_profile_photos.py index 770b0ec8..f162b077 100644 --- a/pyrogram/client/types/messages_and_media/user_profile_photos.py +++ b/pyrogram/client/types/messages_and_media/user_profile_photos.py @@ -37,11 +37,11 @@ class UserProfilePhotos(PyrogramType): __slots__ = ["total_count", "photos"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - total_count: int, - photos: List[Photo] + self, + *, + client: "pyrogram.client.ext.BaseClient", + total_count: int, + photos: List[Photo] ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/venue.py b/pyrogram/client/types/messages_and_media/venue.py index 5dd81093..97829142 100644 --- a/pyrogram/client/types/messages_and_media/venue.py +++ b/pyrogram/client/types/messages_and_media/venue.py @@ -47,14 +47,14 @@ class Venue(PyrogramType): __slots__ = ["location", "title", "address", "foursquare_id", "foursquare_type"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - location: Location, - title: str, - address: str, - foursquare_id: str = None, - foursquare_type: str = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + location: Location, + title: str, + address: str, + foursquare_id: str = None, + foursquare_type: str = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/video.py b/pyrogram/client/types/messages_and_media/video.py index 39ec1455..caf34ce9 100644 --- a/pyrogram/client/types/messages_and_media/video.py +++ b/pyrogram/client/types/messages_and_media/video.py @@ -60,18 +60,18 @@ class Video(PyrogramType): __slots__ = ["file_id", "thumb", "file_name", "mime_type", "file_size", "date", "width", "height", "duration"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - width: int, - height: int, - duration: int, - thumb: PhotoSize = None, - file_name: str = None, - mime_type: str = None, - file_size: int = None, - date: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + width: int, + height: int, + duration: int, + thumb: PhotoSize = None, + file_name: str = None, + mime_type: str = None, + file_size: int = None, + date: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/video_note.py b/pyrogram/client/types/messages_and_media/video_note.py index afa4ad46..a1b3856c 100644 --- a/pyrogram/client/types/messages_and_media/video_note.py +++ b/pyrogram/client/types/messages_and_media/video_note.py @@ -54,16 +54,16 @@ class VideoNote(PyrogramType): __slots__ = ["file_id", "thumb", "mime_type", "file_size", "date", "length", "duration"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - length: int, - duration: int, - thumb: PhotoSize = None, - mime_type: str = None, - file_size: int = None, - date: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + length: int, + duration: int, + thumb: PhotoSize = None, + mime_type: str = None, + file_size: int = None, + date: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/messages_and_media/voice.py b/pyrogram/client/types/messages_and_media/voice.py index d5028cd3..b4063088 100644 --- a/pyrogram/client/types/messages_and_media/voice.py +++ b/pyrogram/client/types/messages_and_media/voice.py @@ -50,15 +50,15 @@ class Voice(PyrogramType): __slots__ = ["file_id", "duration", "waveform", "mime_type", "file_size", "date"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - file_id: str, - duration: int, - waveform: bytes = None, - mime_type: str = None, - file_size: int = None, - date: int = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + file_id: str, + duration: int, + waveform: bytes = None, + mime_type: str = None, + file_size: int = None, + date: int = None ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index 81067821..5488b846 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -87,24 +87,24 @@ class Chat(PyrogramType): ] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - id: int, - type: str, - title: str = None, - username: str = None, - first_name: str = None, - last_name: str = None, - photo: ChatPhoto = None, - description: str = None, - invite_link: str = None, - pinned_message=None, - sticker_set_name: str = None, - can_set_sticker_set: bool = None, - members_count: int = None, - restriction_reason: str = None, - permissions: "pyrogram.ChatPermissions" = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + id: int, + type: str, + title: str = None, + username: str = None, + first_name: str = None, + last_name: str = None, + photo: ChatPhoto = None, + description: str = None, + invite_link: str = None, + pinned_message=None, + sticker_set_name: str = None, + can_set_sticker_set: bool = None, + members_count: int = None, + restriction_reason: str = None, + permissions: "pyrogram.ChatPermissions" = None ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/chat_member.py b/pyrogram/client/types/user_and_chats/chat_member.py index 07a3d190..35911210 100644 --- a/pyrogram/client/types/user_and_chats/chat_member.py +++ b/pyrogram/client/types/user_and_chats/chat_member.py @@ -54,16 +54,16 @@ class ChatMember(PyrogramType): __slots__ = ["user", "status", "date", "invited_by", "promoted_by", "restricted_by", "permissions"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - user: "pyrogram.User", - status: str, - date: int = None, - invited_by: "pyrogram.User" = None, - promoted_by: "pyrogram.User" = None, - restricted_by: "pyrogram.User" = None, - permissions: "pyrogram.ChatPermissions" = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + user: "pyrogram.User", + status: str, + date: int = None, + invited_by: "pyrogram.User" = None, + promoted_by: "pyrogram.User" = None, + restricted_by: "pyrogram.User" = None, + permissions: "pyrogram.ChatPermissions" = None ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/chat_members.py b/pyrogram/client/types/user_and_chats/chat_members.py index 0578e04e..3c89b124 100644 --- a/pyrogram/client/types/user_and_chats/chat_members.py +++ b/pyrogram/client/types/user_and_chats/chat_members.py @@ -38,11 +38,11 @@ class ChatMembers(PyrogramType): __slots__ = ["total_count", "chat_members"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - total_count: int, - chat_members: List[ChatMember] + self, + *, + client: "pyrogram.client.ext.BaseClient", + total_count: int, + chat_members: List[ChatMember] ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/chat_photo.py b/pyrogram/client/types/user_and_chats/chat_photo.py index deec5770..6fbc779d 100644 --- a/pyrogram/client/types/user_and_chats/chat_photo.py +++ b/pyrogram/client/types/user_and_chats/chat_photo.py @@ -38,11 +38,11 @@ class ChatPhoto(PyrogramType): __slots__ = ["small_file_id", "big_file_id"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - small_file_id: str, - big_file_id: str + self, + *, + client: "pyrogram.client.ext.BaseClient", + small_file_id: str, + big_file_id: str ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/chat_preview.py b/pyrogram/client/types/user_and_chats/chat_preview.py index 9c9c71ec..ddd84b09 100644 --- a/pyrogram/client/types/user_and_chats/chat_preview.py +++ b/pyrogram/client/types/user_and_chats/chat_preview.py @@ -48,14 +48,14 @@ class ChatPreview(PyrogramType): __slots__ = ["title", "photo", "type", "members_count", "members"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - title: str, - photo: ChatPhoto, - type: str, - members_count: int, - members: List[User] = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + title: str, + photo: ChatPhoto, + type: str, + members_count: int, + members: List[User] = None ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/dialog.py b/pyrogram/client/types/user_and_chats/dialog.py index 11a1ae19..1bbd3b4b 100644 --- a/pyrogram/client/types/user_and_chats/dialog.py +++ b/pyrogram/client/types/user_and_chats/dialog.py @@ -49,15 +49,15 @@ class Dialog(PyrogramType): __slots__ = ["chat", "top_message", "unread_messages_count", "unread_mentions_count", "unread_mark", "is_pinned"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - chat: Chat, - top_message: "pyrogram.Message", - unread_messages_count: int, - unread_mentions_count: int, - unread_mark: bool, - is_pinned: bool + self, + *, + client: "pyrogram.client.ext.BaseClient", + chat: Chat, + top_message: "pyrogram.Message", + unread_messages_count: int, + unread_mentions_count: int, + unread_mark: bool, + is_pinned: bool ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/dialogs.py b/pyrogram/client/types/user_and_chats/dialogs.py index 27222a91..bd29ea83 100644 --- a/pyrogram/client/types/user_and_chats/dialogs.py +++ b/pyrogram/client/types/user_and_chats/dialogs.py @@ -39,11 +39,11 @@ class Dialogs(PyrogramType): __slots__ = ["total_count", "dialogs"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - total_count: int, - dialogs: List[Dialog] + self, + *, + client: "pyrogram.client.ext.BaseClient", + total_count: int, + dialogs: List[Dialog] ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/user.py b/pyrogram/client/types/user_and_chats/user.py index f5c00ac0..5718b917 100644 --- a/pyrogram/client/types/user_and_chats/user.py +++ b/pyrogram/client/types/user_and_chats/user.py @@ -76,23 +76,23 @@ class User(PyrogramType): ] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - id: int, - is_self: bool, - is_contact: bool, - is_mutual_contact: bool, - is_deleted: bool, - is_bot: bool, - first_name: str, - last_name: str = None, - status: UserStatus = None, - username: str = None, - language_code: str = None, - phone_number: str = None, - photo: ChatPhoto = None, - restriction_reason: str = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + id: int, + is_self: bool, + is_contact: bool, + is_mutual_contact: bool, + is_deleted: bool, + is_bot: bool, + first_name: str, + last_name: str = None, + status: UserStatus = None, + username: str = None, + language_code: str = None, + phone_number: str = None, + photo: ChatPhoto = None, + restriction_reason: str = None ): super().__init__(client) diff --git a/pyrogram/client/types/user_and_chats/user_status.py b/pyrogram/client/types/user_and_chats/user_status.py index 871978d0..170ce373 100644 --- a/pyrogram/client/types/user_and_chats/user_status.py +++ b/pyrogram/client/types/user_and_chats/user_status.py @@ -68,17 +68,17 @@ class UserStatus(PyrogramType, Update): __slots__ = ["user_id", "online", "offline", "date", "recently", "within_week", "within_month", "long_time_ago"] def __init__( - self, - *, - client: "pyrogram.client.ext.BaseClient", - user_id: int, - online: bool = None, - offline: bool = None, - date: int = None, - recently: bool = None, - within_week: bool = None, - within_month: bool = None, - long_time_ago: bool = None + self, + *, + client: "pyrogram.client.ext.BaseClient", + user_id: int, + online: bool = None, + offline: bool = None, + date: int = None, + recently: bool = None, + within_week: bool = None, + within_month: bool = None, + long_time_ago: bool = None ): super().__init__(client) diff --git a/pyrogram/session/auth.py b/pyrogram/session/auth.py index 9d8e4b16..89e5b61f 100644 --- a/pyrogram/session/auth.py +++ b/pyrogram/session/auth.py @@ -45,10 +45,10 @@ class Auth: @staticmethod def pack(data: Object) -> bytes: return ( - bytes(8) - + Long(MsgId()) - + Int(len(data.write())) - + data.write() + bytes(8) + + Long(MsgId()) + + Int(len(data.write())) + + data.write() ) @staticmethod @@ -144,13 +144,13 @@ class Auth: new_nonce = new_nonce.to_bytes(32, "little", signed=True) tmp_aes_key = ( - sha1(new_nonce + server_nonce).digest() - + sha1(server_nonce + new_nonce).digest()[:12] + sha1(new_nonce + server_nonce).digest() + + sha1(server_nonce + new_nonce).digest()[:12] ) tmp_aes_iv = ( - sha1(server_nonce + new_nonce).digest()[12:] - + sha1(new_nonce + new_nonce).digest() + new_nonce[:4] + sha1(server_nonce + new_nonce).digest()[12:] + + sha1(new_nonce + new_nonce).digest() + new_nonce[:4] ) server_nonce = int.from_bytes(server_nonce, "little", signed=True)