1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge pull request #760 from HolidayMan/patch-1

Some clarification of custom listeners working
This commit is contained in:
Badiboy 2020-02-27 11:45:04 +03:00 committed by GitHub
commit 6e6420a331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -466,7 +466,10 @@ The TeleBot constructor takes the following optional arguments:
TeleBot should execute message handlers on it's polling Thread.
### The listener mechanism
As an alternative to the message handlers, one can also register a function as a listener to TeleBot. Example:
As an alternative to the message handlers, one can also register a function as a listener to TeleBot.
NOTICE: handlers won't disappear! Your message will be processed both by handlers and listeners. Also, it's impossible to predict which will work at first because of threading. If you use threaded=False, custom listeners will work earlier, after them handlers will be called.
Example:
```python
def handle_messages(messages):
for message in messages: