From d71467f09018553a8f2c1942468c482d3aaaa2c9 Mon Sep 17 00:00:00 2001 From: Lonami Date: Sat, 23 Sep 2017 11:41:23 +0200 Subject: [PATCH] Now invoking from ReadThread returns None instead raising --- Working-with-Updates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Working-with-Updates.md b/Working-with-Updates.md index 2e964ea..0f4045e 100644 --- a/Working-with-Updates.md +++ b/Working-with-Updates.md @@ -19,11 +19,11 @@ client.remove_update_handler(my_handler) # handlers = client.list_update_handlers() ``` -An update handler is nothing else than a method accepting a single parameter, the update object to be processed. Please **note** that you should only run **short-running operations** here! You won't be able to receive the result of invoking other requests, or even other updates, while an update handler is running. +An update handler is nothing else than a method accepting a single parameter, the update object to be processed. Please **note** that you should only run **short-running operations** here! Any request you try to invoke from within these will `return None` so the operation ends immediately instead having to wait for it. Updates will be processed as long as there is at least one handler added, and adding the first handler will trigger a forced synchronization of the update state (manually called through `client.sync_updates()`). -**You cannot invoke requests from within these handlers**. The handlers are called from a **read-only thread**, and attempting to invoke a request (hence sending it) will raise an `AssertionError`. +**You cannot invoke requests from within these handlers**. They will all `return None`. The handlers are called from a **read-only thread**, and attempting to invoke a request (hence sending it) will have no effect. ## Reacting to updates