From 2a309a204000049d27c98a80250fd147c881b210 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Shojib Date: Mon, 20 Jan 2025 23:17:01 +0600 Subject: [PATCH 1/5] Update error_scrape.yml --- .github/workflows/error_scrape.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/error_scrape.yml b/.github/workflows/error_scrape.yml index bb972f5d..a171bfe5 100644 --- a/.github/workflows/error_scrape.yml +++ b/.github/workflows/error_scrape.yml @@ -6,6 +6,7 @@ jobs: build: permissions: id-token: write + contents: write name: scrape-errors runs-on: ubuntu-latest steps: From ca57fdd5d16f3fb86caed07d9bc7efd1e01b4b6e Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Shojib Date: Mon, 20 Jan 2025 23:18:27 +0600 Subject: [PATCH 2/5] Update error_scrape.yml --- .github/workflows/error_scrape.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/error_scrape.yml b/.github/workflows/error_scrape.yml index a171bfe5..5d911c2a 100644 --- a/.github/workflows/error_scrape.yml +++ b/.github/workflows/error_scrape.yml @@ -5,7 +5,6 @@ on: jobs: build: permissions: - id-token: write contents: write name: scrape-errors runs-on: ubuntu-latest From 63173f97d3adca4a9ad7f606c254cbf564934a00 Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Shojib Date: Mon, 20 Jan 2025 23:21:51 +0600 Subject: [PATCH 3/5] Update unknown_errors (#43) --- compiler/errors/source/400_BAD_REQUEST.tsv | 31 +++++++++++++++++++ compiler/errors/source/403_FORBIDDEN.tsv | 2 ++ .../source/500_INTERNAL_SERVER_ERROR.tsv | 3 ++ 3 files changed, 36 insertions(+) diff --git a/compiler/errors/source/400_BAD_REQUEST.tsv b/compiler/errors/source/400_BAD_REQUEST.tsv index a2428d80..e3a1a0c3 100644 --- a/compiler/errors/source/400_BAD_REQUEST.tsv +++ b/compiler/errors/source/400_BAD_REQUEST.tsv @@ -46,6 +46,7 @@ BOT_GAMES_DISABLED Bot games cannot be used in this type of chat BOT_GROUPS_BLOCKED This bot can't be added to groups BOT_INLINE_DISABLED The inline feature of the bot is disabled BOT_INVALID This is not a valid bot +BOT_INVOICE_INVALID The specified invoice is invalid. BOT_METHOD_INVALID The method can't be used by bots BOT_MISSING This method can only be run by a bot BOT_NOT_CONNECTED_YET No [business bot](https://core.telegram.org/api/business#connected-bots) is connected to the currently logged in user. @@ -60,10 +61,13 @@ BROADCAST_ID_INVALID The channel is invalid BROADCAST_PUBLIC_VOTERS_FORBIDDEN Polls with public voters cannot be sent in channels BROADCAST_REQUIRED The request can only be used with a channel BUSINESS_PEER_INVALID Messages can't be set to the specified peer through the current [business connection](https://core.telegram.org/api/business#connected-bots). +BUSINESS_PEER_USAGE_MISSING You cannot send a message to a user through a [business connection](https://core.telegram.org/api/business#connected-bots) if the user hasn't recently contacted us. BUSINESS_RECIPIENTS_EMPTY You didn't set any flag in inputBusinessBotRecipients, thus the bot cannot work with *any* peer. BUSINESS_WORK_HOURS_EMPTY No work hours were specified. BUSINESS_WORK_HOURS_PERIOD_INVALID The specified work hours are invalid, see [here »](https://core.telegram.org/api/business#opening-hours) for the exact requirements. +BUTTON_COPY_TEXT_INVALID The specified [keyboardButtonCopy](https://core.telegram.org/constructor/keyboardButtonCopy).`copy_text` is invalid. BUTTON_DATA_INVALID The button callback data is invalid or too large +BUTTON_ID_INVALID The specified button ID is invalid. BUTTON_POS_INVALID The position of one of the keyboard buttons is invalid (i.e. a Game or Pay button not in the first position, and so on...). BUTTON_TEXT_INVALID The specified button text is invalid BUTTON_TYPE_INVALID The type of one of the buttons you provided is invalid @@ -93,6 +97,7 @@ CHARGE_NOT_FOUND The charge id was not found. CHATLINKS_TOO_MUCH Too many [business chat links](https://core.telegram.org/api/business#business-chat-links) were created, please delete some older links. CHATLINK_SLUG_EMPTY The specified slug is empty. CHATLINK_SLUG_EXPIRED The specified [business chat link](https://core.telegram.org/api/business#business-chat-links) has expired. +CHATLISTS_TOO_MUCH You have created too many folder links, hitting the `chatlist_invites_limit_default`/`chatlist_invites_limit_premium` [limits »](https://core.telegram.org/api/config#chatlist-invites-limit-default). CHATLIST_EXCLUDE_INVALID The specified `exclude_peers` are invalid. CHAT_ABOUT_NOT_MODIFIED The chat about text was not modified because you tried to edit it using the same content CHAT_ABOUT_TOO_LONG The chat about text is too long @@ -104,6 +109,7 @@ CHAT_ID_INVALID The chat id being used is invalid or not known yet. Make sure yo CHAT_INVALID The chat is invalid CHAT_INVITE_PERMANENT The chat invite link is primary CHAT_LINK_EXISTS The action failed because the supergroup is linked to a channel +CHAT_MEMBER_ADD_FAILED Could not add participants. CHAT_NOT_MODIFIED The chat settings (title, permissions, photo, etc..) were not modified because you tried to edit them using the same content CHAT_PUBLIC_REQUIRED You can only enable join requests in public groups. CHAT_RESTRICTED The chat is restricted and cannot be used @@ -166,6 +172,7 @@ ERROR_TEXT_EMPTY The provided error message is empty EXPIRE_DATE_INVALID The expiration date is invalid EXPIRE_FORBIDDEN Expire forbidden EXPORT_CARD_INVALID The provided card is invalid +EXTENDED_MEDIA_AMOUNT_INVALID The specified `stars_amount` of the passed [inputMediaPaidMedia](https://core.telegram.org/constructor/inputMediaPaidMedia) is invalid. EXTERNAL_URL_INVALID The external media URL is invalid FIELD_NAME_EMPTY The field with the name FIELD_NAME is missing FIELD_NAME_INVALID The field with the name FIELD_NAME is invalid @@ -181,6 +188,7 @@ FILE_PART_LENGTH_INVALID The length of a file part is invalid FILE_PART_SIZE_CHANGED The part size is different from the size of one of the previous parts in the same file FILE_PART_SIZE_INVALID The file part size is invalid FILE_PART_TOO_BIG The size limit for the content of the file part has been exceeded +FILE_PART_TOO_SMALL The size of the uploaded file part is too small, please see the documentation for the allowed sizes. FILE_PART_X_MISSING Part {value} of the file is missing from storage FILE_REFERENCE_EMPTY The file id contains an empty file reference, you must obtain a valid one by fetching the message from the origin context FILE_REFERENCE_EXPIRED The file id contains an expired file reference, you must obtain a valid one by fetching the message from the origin context @@ -197,7 +205,9 @@ FIRSTNAME_INVALID The first name is invalid FOLDER_ID_EMPTY The folder you tried to delete was already empty FOLDER_ID_INVALID The folder id is invalid FORM_EXPIRED The form was generated more than 10 minutes ago and has expired, please re-generate it using [payments.getPaymentForm](https://core.telegram.org/method/payments.getPaymentForm) and pass the new `form_id`. +FORM_ID_EMPTY The specified form ID is empty. FORM_ID_EXPIRED The specified id has expired. +FORM_UNSUPPORTED Please update your client. FORUM_ENABLED You can't execute the specified action because the group is a [forum](https://core.telegram.org/api/forum), disable forum functionality to continue. FRESH_CHANGE_ADMINS_FORBIDDEN You can't change administrator settings in this chat because your session was logged-in recently FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors @@ -223,6 +233,8 @@ GROUP_CALL_INVALID The group call is invalid HASHTAG_INVALID The specified hashtag is invalid. HASH_INVALID The provided hash is invalid HIDE_REQUESTER_MISSING The join request was missing or was already handled +ID_EXPIRED The passed prepared inline message ID has expired. +ID_INVALID The passed ID is invalid. IMAGE_PROCESS_FAILED The server failed to process your image IMPORT_FILE_INVALID The imported file is invalid IMPORT_FORMAT_DATE_INVALID The date specified in the import file is invalid. @@ -238,6 +250,7 @@ INPUT_FILE_INVALID The specified [InputFile](https://core.telegram.org/type/Inpu INPUT_FILTER_INVALID The filter is invalid for this query INPUT_LAYER_INVALID The provided layer is invalid INPUT_METHOD_INVALID The method invoked is invalid in the current schema +INPUT_PEERS_EMPTY The specified peer array is empty. INPUT_REQUEST_TOO_LONG The input request is too long INPUT_TEXT_EMPTY The specified text is empty INPUT_TEXT_TOO_LONG The specified text is too long. @@ -251,6 +264,7 @@ INVITE_REQUEST_SENT The request to join this chat or channel has been successful INVITE_REVOKED_MISSING The action required a chat invite link to be revoked first INVITE_SLUG_EMPTY The invite slug is empty INVITE_SLUG_EXPIRED The invite slug is expired +INVITE_SLUG_INVALID The specified invitation slug is invalid. INVOICE_PAYLOAD_INVALID The specified invoice payload is invalid JOIN_AS_PEER_INVALID The specified peer cannot be used to join a group call LANGUAGE_INVALID The specified lang_code is invalid. @@ -326,6 +340,7 @@ PEER_FLOOD The method can't be used because your account is currently limited PEER_HISTORY_EMPTY Peer history empty PEER_ID_INVALID The peer id being used is invalid or not known yet. Make sure you meet the peer before interacting with it PEER_ID_NOT_SUPPORTED The provided peer id is not supported +PEER_TYPES_INVALID The passed [keyboardButtonSwitchInline](https://core.telegram.org/constructor/keyboardButtonSwitchInline).`peer_types` field is invalid. PERSISTENT_TIMESTAMP_EMPTY The pts argument is empty PERSISTENT_TIMESTAMP_INVALID The persistent timestamp is invalid PHONE_CODE_EMPTY The phone code is missing @@ -363,6 +378,7 @@ POLL_QUESTION_INVALID The poll question is invalid POLL_UNSUPPORTED This layer does not support polls in the invoked method POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method PREMIUM_ACCOUNT_REQUIRED The method requires a premium user account +PRICING_CHAT_INVALID The pricing for the [subscription](https://core.telegram.org/api/subscriptions) is invalid, the maximum price is specified in the [`stars_subscription_amount_max` config key »](https://core.telegram.org/api/config#stars-subscription-amount-max). PRIVACY_KEY_INVALID The privacy key is invalid PRIVACY_TOO_LONG Your privacy exception list has exceeded the maximum capacity PRIVACY_VALUE_INVALID The privacy value is invalid @@ -432,8 +448,17 @@ SLOWMODE_MULTI_MSGS_DISABLED Slowmode is enabled, you cannot forward multiple me SLUG_INVALID The specified invoice slug is invalid. SMSJOB_ID_INVALID The specified job ID is invalid. SMS_CODE_CREATE_FAILED An error occurred while creating the SMS code +SRP_A_INVALID The specified inputCheckPasswordSRP.A value is invalid. SRP_ID_INVALID Invalid SRP ID provided SRP_PASSWORD_CHANGED The password has changed +STARGIFT_INVALID The passed [inputInvoiceStarGift](https://core.telegram.org/constructor/inputInvoiceStarGift) is invalid. +STARGIFT_USAGE_LIMITED The gift is sold out. +STARREF_AWAITING_END The previous referral program was terminated less than 24 hours ago: further changes can be made after the date specified in userFull.starref_program.end_date. +STARREF_HASH_REVOKED The specified affiliate link was already revoked. +STARREF_PERMILLE_INVALID The specified commission_permille is invalid: the minimum and maximum values for this parameter are contained in the [starref_min_commission_permille](https://core.telegram.org/api/config#starref-min-commission-permille) and [starref_max_commission_permille](https://core.telegram.org/api/config#starref-max-commission-permille) client configuration parameters. +STARREF_PERMILLE_TOO_LOW The specified commission_permille is too low: the minimum and maximum values for this parameter are contained in the [starref_min_commission_permille](https://core.telegram.org/api/config#starref-min-commission-permille) and [starref_max_commission_permille](https://core.telegram.org/api/config#starref-max-commission-permille) client configuration parameters. +STARS_INVOICE_INVALID The specified Telegram Star invoice is invalid. +STARS_PAYMENT_REQUIRED To import this chat invite link, you must first [pay for the associated Telegram Star subscription »](https://core.telegram.org/api/subscriptions#channel-subscriptions). START_PARAM_EMPTY The start parameter is empty START_PARAM_INVALID The start parameter is invalid START_PARAM_TOO_LONG The start parameter is too long @@ -466,6 +491,8 @@ STORY_NOT_MODIFIED The new story information you passed is equal to the previous STORY_PERIOD_INVALID The story period is invalid STORY_SEND_FLOOD_MONTHLY_X You've hit the monthly story limit as specified by the [`stories_sent_monthly_limit_*` client configuration parameters](https://core.telegram.org/api/config#stories-sent-monthly-limit-default): wait for the specified number of seconds before posting a new story. STORY_SEND_FLOOD_WEEKLY_X You've hit the weekly story limit as specified by the [`stories_sent_weekly_limit_*` client configuration parameters](https://core.telegram.org/api/config#stories-sent-weekly-limit-default): wait for the specified number of seconds before posting a new story. +SUBSCRIPTION_EXPORT_MISSING You cannot send a [bot subscription invoice](https://core.telegram.org/api/subscriptions#bot-subscriptions) directly, you may only create invoice links using [payments.exportInvoice](https://core.telegram.org/method/payments.exportInvoice). +SUBSCRIPTION_PERIOD_INVALID The specified subscription_pricing.period is invalid. SWITCH_PM_TEXT_EMPTY The switch_pm.text field was empty SWITCH_WEBVIEW_URL_INVALID The URL specified in switch_webview.url is invalid! TAKEOUT_INVALID The takeout id is invalid @@ -473,10 +500,12 @@ TAKEOUT_REQUIRED The method must be invoked inside a takeout session TASK_ALREADY_EXISTS An email reset was already requested. TEMP_AUTH_KEY_ALREADY_BOUND The passed temporary key is already bound to another perm_auth_key_id TEMP_AUTH_KEY_EMPTY The temporary auth key provided is empty +TERMS_URL_INVALID The specified [invoice](https://core.telegram.org/constructor/invoice).`terms_url` is invalid. THEME_FILE_INVALID Invalid theme file provided THEME_FORMAT_INVALID Invalid theme format provided THEME_INVALID Invalid theme provided THEME_MIME_INVALID You cannot create this theme because the mime-type is invalid +THEME_PARAMS_INVALID The specified `theme_params` field is invalid. THEME_TITLE_INVALID The specified theme title is invalid TIMEZONE_INVALID The specified timezone does not exist. TITLE_INVALID The specified stickerpack title is invalid @@ -494,6 +523,7 @@ TOPIC_ID_INVALID The provided topic ID is invalid TOPIC_NOT_MODIFIED The topic was not modified TOPIC_TITLE_EMPTY The specified topic title is empty. TO_LANG_INVALID The specified destination language is invalid +TRANSACTION_ID_INVALID The specified transaction ID is invalid. TRANSCRIPTION_FAILED Telegram is having internal problems. Please try again later to transcribe the audio. TRANSLATE_REQ_QUOTA_EXCEEDED Translation is currently unavailable due to a temporary server-side lack of resources. TTL_DAYS_INVALID The provided TTL days is invalid @@ -524,6 +554,7 @@ USER_BOT_INVALID This method can only be used by a bot USER_BOT_REQUIRED The method can be used by bots only USER_CHANNELS_TOO_MUCH The user is already in too many channels or supergroups USER_CREATOR You can't leave this channel because you're its creator +USER_GIFT_UNAVAILABLE Gifts are not available in the current region ([stars_gifts_enabled](https://core.telegram.org/api/config#stars-gifts-enabled) is equal to false). USER_ID_INVALID The user id being used is invalid or not known yet. Make sure you meet the user before interacting with it USER_INVALID The provided user is invalid USER_IS_BLOCKED The user blocked you diff --git a/compiler/errors/source/403_FORBIDDEN.tsv b/compiler/errors/source/403_FORBIDDEN.tsv index 3e4d7a19..69ada4ba 100644 --- a/compiler/errors/source/403_FORBIDDEN.tsv +++ b/compiler/errors/source/403_FORBIDDEN.tsv @@ -20,6 +20,7 @@ CHAT_SEND_ROUNDVIDEOS_FORBIDDEN You can't send round videos to this chat. CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat CHAT_SEND_VIDEOS_FORBIDDEN You can't send videos in this chat CHAT_SEND_VOICES_FORBIDDEN You can't send voice recordings in this chat +CHAT_TYPE_INVALID The specified user type is invalid. CHAT_WRITE_FORBIDDEN You can't write in this chat EDIT_BOT_INVITE_FORBIDDEN Bots' chat invite links can't be edited GROUPCALL_ALREADY_STARTED The groupcall has already started, you can join directly using phone.joinGroupCall @@ -31,6 +32,7 @@ MESSAGE_DELETE_FORBIDDEN You don't have rights to delete messages in this chat, NOT_ALLOWED Not allowed NOT_ELIGIBLE You are not eligible for this action PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall +PEER_ID_INVALID The provided peer id is invalid. POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method PREMIUM_ACCOUNT_REQUIRED This action requires a premium account PRIVACY_PREMIUM_REQUIRED The user has restricted from sending messages OR This action requires a premium account diff --git a/compiler/errors/source/500_INTERNAL_SERVER_ERROR.tsv b/compiler/errors/source/500_INTERNAL_SERVER_ERROR.tsv index f2c1a370..b6521983 100644 --- a/compiler/errors/source/500_INTERNAL_SERVER_ERROR.tsv +++ b/compiler/errors/source/500_INTERNAL_SERVER_ERROR.tsv @@ -1,6 +1,8 @@ id message API_CALL_ERROR API call error due to Telegram having internal problems. Please try again later +AUTH_KEY_UNSYNCHRONIZED Internal error, please repeat the method call. AUTH_RESTART User authorization has restarted +AUTH_RESTART_X Internal error (debug info {value}), please repeat the method call. CALL_OCCUPY_FAILED The call failed because the user is already making another call CDN_UPLOAD_TIMEOUT A server-side timeout occurred while reuploading the file to the CDN DC. CHAT_FROM_CALL_CHANGED @@ -45,6 +47,7 @@ SIGN_IN_FAILED Failure while signing in due to Telegram having internal problems STORAGE_CHECK_FAILED Server storage check failed due to Telegram having internal problems. Please try again later STORE_INVALID_SCALAR_TYPE Telegram is having internal problems. Please try again later TIMEOUT A timeout occurred while fetching data from the worker +TRANSLATE_REQ_FAILED Translation failed, please try again later. UNKNOWN_METHOD The method you tried to call cannot be called on non-CDN DCs UPLOAD_NO_VOLUME Telegram is having internal problems. Please try again later VOLUME_LOC_NOT_FOUND Telegram is having internal problems. Please try again later From 7ddf9b49491c8fabfe3e6e2bfbb0e6c012cf539e Mon Sep 17 00:00:00 2001 From: Mehedi Hasan Shojib Date: Wed, 26 Nov 2025 12:37:01 +0600 Subject: [PATCH 4/5] Add support for Python 3.14 in pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 259a0f78..f9954277 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] [tool.hatch.version] From 6eb8fdfd93da5de9f74ac71f3a5368b036656c22 Mon Sep 17 00:00:00 2001 From: 5hojib Date: Wed, 26 Nov 2025 06:37:27 +0000 Subject: [PATCH 5/5] InkyPinkyPonky [no ci] Signed-off-by: 5hojib --- compiler/docs/compiler.py | 2 +- pyrogram/methods/chats/get_forum_topics_by_id.py | 2 +- pyrogram/raw/core/gzip_packed.py | 4 +++- pyrogram/raw/core/primitives/double.py | 2 +- pyrogram/raw/core/primitives/string.py | 4 +++- pyrogram/raw/core/primitives/vector.py | 2 +- pyrogram/raw/core/tl_object.py | 2 +- pyrogram/storage/memory_storage.py | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 4b6bf041..d240e322 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -852,7 +852,7 @@ def get_title_list(s: str) -> list: fmt_keys = {} for k, v in categories.items(): - name, *bound_methods = get_title_list(v) + _name, *bound_methods = get_title_list(v) fmt_keys.update( { diff --git a/pyrogram/methods/chats/get_forum_topics_by_id.py b/pyrogram/methods/chats/get_forum_topics_by_id.py index c9593cbd..f262dac6 100644 --- a/pyrogram/methods/chats/get_forum_topics_by_id.py +++ b/pyrogram/methods/chats/get_forum_topics_by_id.py @@ -47,7 +47,7 @@ async def get_forum_topics_by_id( Raises: ValueError: In case of invalid arguments. """ - ids, ids_type = (topic_ids, int) if topic_ids else (None, None) + ids, _ids_type = (topic_ids, int) if topic_ids else (None, None) if ids is None: raise ValueError("No argument supplied. Either pass topic_ids") diff --git a/pyrogram/raw/core/gzip_packed.py b/pyrogram/raw/core/gzip_packed.py index 3d91ed64..a1fe1c92 100644 --- a/pyrogram/raw/core/gzip_packed.py +++ b/pyrogram/raw/core/gzip_packed.py @@ -22,7 +22,9 @@ def __init__(self, packed_data: TLObject) -> None: @staticmethod def read(data: BytesIO, *args: Any) -> GzipPacked: # noqa: ARG004 # Return the Object itself instead of a GzipPacked wrapping it - return cast(GzipPacked, TLObject.read(BytesIO(decompress(Bytes.read(data))))) + return cast( + "GzipPacked", TLObject.read(BytesIO(decompress(Bytes.read(data)))) + ) def write(self, *args: Any) -> bytes: # noqa: ARG002 b = BytesIO() diff --git a/pyrogram/raw/core/primitives/double.py b/pyrogram/raw/core/primitives/double.py index 2ee3b330..bb9a2932 100644 --- a/pyrogram/raw/core/primitives/double.py +++ b/pyrogram/raw/core/primitives/double.py @@ -12,7 +12,7 @@ class Double(bytes, TLObject): @classmethod def read(cls, data: BytesIO, *args: Any) -> float: # noqa: ARG003 - return cast(float, unpack("d", data.read(8))[0]) + return cast("float", unpack("d", data.read(8))[0]) def __new__(cls, value: float) -> bytes: # type: ignore return pack("d", value) diff --git a/pyrogram/raw/core/primitives/string.py b/pyrogram/raw/core/primitives/string.py index 221c0aa6..822f8d8b 100644 --- a/pyrogram/raw/core/primitives/string.py +++ b/pyrogram/raw/core/primitives/string.py @@ -11,7 +11,9 @@ class String(Bytes): @classmethod def read(cls, data: BytesIO, *args) -> str: # noqa: ARG003 - return cast(bytes, super(String, String).read(data)).decode(errors="replace") + return cast("bytes", super(String, String).read(data)).decode( + errors="replace" + ) def __new__(cls, value: str) -> bytes: return super().__new__(cls, value.encode()) diff --git a/pyrogram/raw/core/primitives/vector.py b/pyrogram/raw/core/primitives/vector.py index 9443da23..37e5acd8 100644 --- a/pyrogram/raw/core/primitives/vector.py +++ b/pyrogram/raw/core/primitives/vector.py @@ -45,5 +45,5 @@ def read(cls, data: BytesIO, t: Any = None, *args: Any) -> List: # noqa: ARG003 def __new__(cls, value: list, t: Any = None) -> bytes: # type: ignore return b"".join( [Int(cls.ID, False), Int(len(value))] - + [cast(bytes, t(i)) if t else i.write() for i in value], + + [cast("bytes", t(i)) if t else i.write() for i in value], ) diff --git a/pyrogram/raw/core/tl_object.py b/pyrogram/raw/core/tl_object.py index 1954f390..c6abf475 100644 --- a/pyrogram/raw/core/tl_object.py +++ b/pyrogram/raw/core/tl_object.py @@ -16,7 +16,7 @@ class TLObject: @classmethod def read(cls, b: BytesIO, *args: Any) -> Any: - return cast(TLObject, objects[int.from_bytes(b.read(4), "little")]).read( + return cast("TLObject", objects[int.from_bytes(b.read(4), "little")]).read( b, *args, ) diff --git a/pyrogram/storage/memory_storage.py b/pyrogram/storage/memory_storage.py index 0db90604..cc0ddc19 100644 --- a/pyrogram/storage/memory_storage.py +++ b/pyrogram/storage/memory_storage.py @@ -59,7 +59,7 @@ async def open(self) -> None: # Telethon format string = self.session_string[1:] ip_len = 4 if len(string) == 352 else 16 - dc_id, ip, port, auth_key = struct.unpack( + dc_id, _ip, _port, auth_key = struct.unpack( f">B{ip_len}sH256s", base64.urlsafe_b64decode(string), )