From b39a6cd2d4fa6d7f86d34b273714eac57439c348 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 20 Mar 2021 10:37:01 +0100 Subject: [PATCH] Add FAQ about sqlite3.InterfaceError --- docs/source/faq.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 82454d0b..4bfc7135 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -307,16 +307,19 @@ sqlite3.OperationalError: unable to open database file Stackoverflow to the rescue: https://stackoverflow.com/questions/4636970 -FileNotFoundError when using PyInstaller ----------------------------------------- +sqlite3.InterfaceError: Error binding parameter 0 +------------------------------------------------- -Pyrogram uses two files that are not Python files, which are not included automatically in the PyInstaller bundle: +This error occurs when you pass a chat id value of the wrong type when trying to call a method. Most likely, you +accidentally passed the whole user or chat object instead of the id or username. -- ``pyrogram/mime.types`` -- ``pyrogram/storage/schema.sql`` +.. code-block:: python -To fix the issue, you have to locate your local Pyrogram installation and pass those files to PyInstaller. More info in -their docs https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-files-to-the-bundle. + # Wrong. You passed the whole Chat instance + app.send_message(chat, "text") + + # Correct + app.send_message(chat.id, "text") My verification code expires immediately! -----------------------------------------