diff --git a/compiler/error/source/400_BAD_REQUEST.tsv b/compiler/error/source/400_BAD_REQUEST.tsv index 8e82c9f6..43bade44 100644 --- a/compiler/error/source/400_BAD_REQUEST.tsv +++ b/compiler/error/source/400_BAD_REQUEST.tsv @@ -105,4 +105,6 @@ MEGAGROUP_PREHISTORY_HIDDEN The action failed because the supergroup has the pre CHAT_LINK_EXISTS The action failed because the supergroup is linked to a channel LINK_NOT_MODIFIED The chat link was not modified because you tried to link to the same target BROADCAST_ID_INVALID The channel is invalid -MEGAGROUP_ID_INVALID The supergroup is invalid \ No newline at end of file +MEGAGROUP_ID_INVALID The supergroup is invalid +BUTTON_DATA_INVALID The button callback data contains invalid data or exceeds 64 bytes +START_PARAM_INVALID The start parameter is invalid \ No newline at end of file diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 449076af..05fa0bb5 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -1,6 +1,9 @@ Pyrogram FAQ ============ +.. role:: strike + :class: strike + This FAQ page provides answers to common questions about Pyrogram and, to some extent, Telegram in general. .. tip:: @@ -102,9 +105,11 @@ one: ``CAADBAADyg4AAvLQYAEYD4F7vcZ43AI``. Can I use Bot API's file_ids in Pyrogram? ----------------------------------------- -Definitely! All file ids you might have taken from the Bot API are 100% compatible and re-usable in Pyrogram... +:strike:`Definitely! All file ids you might have taken from the Bot API are 100% compatible and re-usable in Pyrogram.` -...at least for now. +Starting from :doc:`Pyrogram v0.14.1 (Layer 100) `, the file_id format of all photo-like objects has +changed. Types affected are: :obj:`~pyrogram.Thumbnail`, :obj:`~pyrogram.ChatPhoto` and :obj:`~pyrogram.Photo`. Any +other file id remains compatible with the Bot API. Telegram is slowly changing some server's internals and it's doing it in such a way that file ids are going to break inevitably. Not only this, but it seems that the new, hypothetical, file ids could also possibly expire at anytime, thus diff --git a/docs/source/glossary.rst b/docs/source/glossary.rst index d5a1bffd..80ae1ecc 100644 --- a/docs/source/glossary.rst +++ b/docs/source/glossary.rst @@ -29,7 +29,7 @@ Terms achieve high quality and availability for services. RPC - Acronym for Remote Procedure call, that is, a function which gets executed at some remote place (i.e. Telegram + Acronym for Remote Procedure Call, that is, a function which gets executed at some remote place (i.e. Telegram server) and not in your local machine. RPCError diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 1f1562d1..84d44560 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -998,7 +998,7 @@ class Client(Methods, BaseClient): def load_config(self): parser = ConfigParser() - parser.read(self.config_file) + parser.read(str(self.config_file)) if self.api_id and self.api_hash: pass diff --git a/pyrogram/client/storage/file_storage.py b/pyrogram/client/storage/file_storage.py index f52a03a9..e6ba8420 100644 --- a/pyrogram/client/storage/file_storage.py +++ b/pyrogram/client/storage/file_storage.py @@ -77,7 +77,7 @@ class FileStorage(MemoryStorage): if file_exists: try: - with open(path, encoding="utf-8") as f: + with open(str(path), encoding="utf-8") as f: session_json = json.load(f) except ValueError: pass @@ -98,7 +98,7 @@ class FileStorage(MemoryStorage): log.warning('Old session file detected: "{}.OLD". You can remove this file now'.format(path.name)) self.conn = sqlite3.connect( - path, + str(path), timeout=1, check_same_thread=False ) diff --git a/pyrogram/client/storage/memory_storage.py b/pyrogram/client/storage/memory_storage.py index 7eb3a7d0..bf000f35 100644 --- a/pyrogram/client/storage/memory_storage.py +++ b/pyrogram/client/storage/memory_storage.py @@ -46,7 +46,7 @@ class MemoryStorage(Storage): def create(self): with self.lock, self.conn: - with open(Path(__file__).parent / "schema.sql", "r") as schema: + with open(str(Path(__file__).parent / "schema.sql"), "r") as schema: self.conn.executescript(schema.read()) self.conn.execute(