Skip to content

Commit b39a6cd

Browse files
committed
Add FAQ about sqlite3.InterfaceError
1 parent c971616 commit b39a6cd

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

docs/source/faq.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,19 @@ sqlite3.OperationalError: unable to open database file
307307

308308
Stackoverflow to the rescue: https://stackoverflow.com/questions/4636970
309309

310-
FileNotFoundError when using PyInstaller
311-
----------------------------------------
310+
sqlite3.InterfaceError: Error binding parameter 0
311+
-------------------------------------------------
312+
313+
This error occurs when you pass a chat id value of the wrong type when trying to call a method. Most likely, you
314+
accidentally passed the whole user or chat object instead of the id or username.
312315

313-
Pyrogram uses two files that are not Python files, which are not included automatically in the PyInstaller bundle:
316+
.. code-block:: python
314317
315-
- ``pyrogram/mime.types``
316-
- ``pyrogram/storage/schema.sql``
318+
# Wrong. You passed the whole Chat instance
319+
app.send_message(chat, "text")
317320
318-
To fix the issue, you have to locate your local Pyrogram installation and pass those files to PyInstaller. More info in
319-
their docs https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-files-to-the-bundle.
321+
# Correct
322+
app.send_message(chat.id, "text")
320323
321324
My verification code expires immediately!
322325
-----------------------------------------

0 commit comments

Comments
 (0)