From 909d570dca83baf40e4734db218596ca02341744 Mon Sep 17 00:00:00 2001 From: Waffle Date: Sun, 27 May 2018 17:01:07 +0300 Subject: [PATCH] Add warning about lambda functions in callbacks --- telebot/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/telebot/__init__.py b/telebot/__init__.py index ca7e92f..e52711a 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -1172,6 +1172,8 @@ class TeleBot: Warning: `message` must be sent with reply_markup=types.ForceReply(), otherwise TeleBot will not be able to see the difference between a reply to `message` and an ordinary message. + Warning: In case `callback` as lambda function, saving reply handlers will not work. + :param message: The message for which we are awaiting a reply. :param callback: The callback function to be called when a reply arrives. Must accept one `message` parameter, which will contain the replied message. @@ -1186,6 +1188,8 @@ class TeleBot: Warning: `message` must be sent with reply_markup=types.ForceReply(), otherwise TeleBot will not be able to see the difference between a reply to `message` and an ordinary message. + Warning: In case `callback` as lambda function, saving reply handlers will not work. + :param message: The message for which we are awaiting a reply. :param callback: The callback function to be called when a reply arrives. Must accept one `message` parameter, which will contain the replied message. @@ -1213,6 +1217,8 @@ class TeleBot: """ Registers a callback function to be notified when new message arrives after `message`. + Warning: In case `callback` as lambda function, saving next step handlers will not work. + :param message: The message for which we want to handle new message in the same chat. :param callback: The callback function which next new message arrives. :param args: Args to pass in callback func @@ -1225,6 +1231,8 @@ class TeleBot: """ Registers a callback function to be notified when new message arrives after `message`. + Warning: In case `callback` as lambda function, saving next step handlers will not work. + :param chat_id: The chat for which we want to handle new message. :param callback: The callback function which next new message arrives. :param args: Args to pass in callback func