From eeda40002dd58abb541934610a0776883b3ad090 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 6 Aug 2019 00:08:31 +0200 Subject: [PATCH 1/3] Better explanation of workdir Client parameter --- docs/source/intro/setup.rst | 6 +++--- pyrogram/client/client.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/intro/setup.rst b/docs/source/intro/setup.rst index 6273b2b2..b3aa1836 100644 --- a/docs/source/intro/setup.rst +++ b/docs/source/intro/setup.rst @@ -29,9 +29,9 @@ Configuration Having the API key from the previous step in handy, we can now begin to configure a Pyrogram project. There are two ways to do so, and you can choose what fits better for you: -- First option (recommended): create a new ``config.ini`` file at the root of your working directory, copy-paste the - following and replace the **api_id** and **api_hash** values with your own. This is the preferred method because - allows you to keep your credentials out of your code without having to deal with how to load them: +- First option (recommended): create a new ``config.ini`` file next to your main script, copy-paste the following and + replace the **api_id** and **api_hash** values with your own. This is the preferred method because allows you to + keep your credentials out of your code without having to deal with how to load them: .. code-block:: ini diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 511dbf2a..7ac155c2 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -153,7 +153,7 @@ class Client(Methods, BaseClient): workdir (``str``, *optional*): Define a custom working directory. The working directory is the location in your filesystem - where Pyrogram will store your session files. Defaults to "." (current directory). + where Pyrogram will store your session files. Defaults to the parent directory of the main script. config_file (``str``, *optional*): Path of the configuration file. Defaults to ./config.ini From b1c63c18d67c9f5d0bec9a332a24968cb7f6e7ca Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 6 Aug 2019 00:11:51 +0200 Subject: [PATCH 2/3] Small document fix --- docs/source/faq.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index a05ff39c..5d4823c8 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -250,8 +250,8 @@ The error in question is ``[400 PEER_ID_INVALID]``, and could mean several thing About the last point: in order for you to meet a user and thus communicate with them, you should ask yourself how to contact people using official apps. The answer is the same for Pyrogram too and involves normal usages such as searching -for usernames, meet them in a common group, have their phone contacts saved, getting a message mentioning them (either a -forward or a mention in the message text). +for usernames, meeting them in a common group, have their phone contacts saved or getting a message mentioning them, +either a forward or a mention in the message text. UnicodeEncodeError: '' codec can't encode … ----------------------------------------------------- From 82e0087def2a06a2ccf3f84e69640ea6e885419c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 6 Aug 2019 01:02:41 +0200 Subject: [PATCH 3/3] Always cast inline query ids to string --- pyrogram/client/types/inline_mode/inline_query_result.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/types/inline_mode/inline_query_result.py b/pyrogram/client/types/inline_mode/inline_query_result.py index ef26eacc..d44a5ee2 100644 --- a/pyrogram/client/types/inline_mode/inline_query_result.py +++ b/pyrogram/client/types/inline_mode/inline_query_result.py @@ -63,7 +63,7 @@ class InlineQueryResult(Object): super().__init__() self.type = type - self.id = str(uuid4()) if id is None else id + self.id = str(uuid4()) if id is None else str(id) self.input_message_content = input_message_content self.reply_markup = reply_markup