mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Remove outdated FAQ
This commit is contained in:
parent
1e66ac2636
commit
b8f39725c5
2 changed files with 0 additions and 30 deletions
|
|
@ -17,7 +17,6 @@ This FAQ page provides answers to common questions about Pyrogram and, to some e
|
||||||
- :doc:`code-hangs-when-calling-stop-restart-add-remove-handler`
|
- :doc:`code-hangs-when-calling-stop-restart-add-remove-handler`
|
||||||
- :doc:`unicodeencodeerror-codec-cant-encode`
|
- :doc:`unicodeencodeerror-codec-cant-encode`
|
||||||
- :doc:`uploading-with-urls-gives-error-webpage-curl-failed`
|
- :doc:`uploading-with-urls-gives-error-webpage-curl-failed`
|
||||||
- :doc:`why-is-the-event-handler-triggered-twice-or-more`
|
|
||||||
- :doc:`sqlite3-operationalerror-database-is-locked`
|
- :doc:`sqlite3-operationalerror-database-is-locked`
|
||||||
- :doc:`sqlite3-interfaceerror-error-binding-parameter`
|
- :doc:`sqlite3-interfaceerror-error-binding-parameter`
|
||||||
- :doc:`socket-send-raised-exception-oserror-timeouterror`
|
- :doc:`socket-send-raised-exception-oserror-timeouterror`
|
||||||
|
|
@ -39,7 +38,6 @@ This FAQ page provides answers to common questions about Pyrogram and, to some e
|
||||||
code-hangs-when-calling-stop-restart-add-remove-handler
|
code-hangs-when-calling-stop-restart-add-remove-handler
|
||||||
unicodeencodeerror-codec-cant-encode
|
unicodeencodeerror-codec-cant-encode
|
||||||
uploading-with-urls-gives-error-webpage-curl-failed
|
uploading-with-urls-gives-error-webpage-curl-failed
|
||||||
why-is-the-event-handler-triggered-twice-or-more
|
|
||||||
sqlite3-operationalerror-database-is-locked
|
sqlite3-operationalerror-database-is-locked
|
||||||
sqlite3-interfaceerror-error-binding-parameter
|
sqlite3-interfaceerror-error-binding-parameter
|
||||||
socket-send-raised-exception-oserror-timeouterror
|
socket-send-raised-exception-oserror-timeouterror
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
Why is the event handler called twice or more?
|
|
||||||
==============================================
|
|
||||||
|
|
||||||
The event handler is being called twice or more because one or more message edit events have arrived.
|
|
||||||
By default, Pyrogram listens to both new and edit message events inside ``on_message`` handlers. To prevent edit events
|
|
||||||
from calling the handler, use the "not edited" filter ``~filters.edited``.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
@app.on_message(... & ~filters.edited)
|
|
||||||
async def handler(client, message):
|
|
||||||
...
|
|
||||||
|
|
||||||
Or, avoid handling any edited message altogether this way:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
@app.on_message(filters.edited)
|
|
||||||
async def edited(client, message):
|
|
||||||
pass
|
|
||||||
|
|
||||||
... # other handlers
|
|
||||||
Loading…
Reference in a new issue