mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge branch 'master' into master
This commit is contained in:
commit
6e502cd1c6
@ -498,8 +498,8 @@ class TeleBot:
|
|||||||
|
|
||||||
def process_new_messages(self, new_messages):
|
def process_new_messages(self, new_messages):
|
||||||
self._notify_next_handlers(new_messages)
|
self._notify_next_handlers(new_messages)
|
||||||
self._notify_state_handlers(new_messages)
|
|
||||||
self._notify_reply_handlers(new_messages)
|
self._notify_reply_handlers(new_messages)
|
||||||
|
self._notify_state_handlers(new_messages)
|
||||||
self.__notify_update(new_messages)
|
self.__notify_update(new_messages)
|
||||||
self._notify_command_handlers(self.message_handlers, new_messages)
|
self._notify_command_handlers(self.message_handlers, new_messages)
|
||||||
|
|
||||||
@ -2390,7 +2390,6 @@ class TeleBot:
|
|||||||
"""
|
"""
|
||||||
return self.current_states.current_state(chat_id)
|
return self.current_states.current_state(chat_id)
|
||||||
|
|
||||||
|
|
||||||
def register_next_step_handler_by_chat_id(
|
def register_next_step_handler_by_chat_id(
|
||||||
self, chat_id: Union[int, str], callback: Callable, *args, **kwargs) -> None:
|
self, chat_id: Union[int, str], callback: Callable, *args, **kwargs) -> None:
|
||||||
"""
|
"""
|
||||||
@ -2462,6 +2461,8 @@ class TeleBot:
|
|||||||
:param new_messages:
|
:param new_messages:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
if not self.current_states: return
|
||||||
|
|
||||||
for i, message in enumerate(new_messages):
|
for i, message in enumerate(new_messages):
|
||||||
need_pop = False
|
need_pop = False
|
||||||
user_state = self.current_states.current_state(message.from_user.id)
|
user_state = self.current_states.current_state(message.from_user.id)
|
||||||
@ -3242,12 +3243,12 @@ class TeleBot:
|
|||||||
return message.content_type == 'text' and util.extract_command(message.text) in filter_value
|
return message.content_type == 'text' and util.extract_command(message.text) in filter_value
|
||||||
elif message_filter == 'chat_types':
|
elif message_filter == 'chat_types':
|
||||||
return message.chat.type in filter_value
|
return message.chat.type in filter_value
|
||||||
elif message_filter == 'state':
|
|
||||||
return True
|
|
||||||
elif message_filter == 'func':
|
elif message_filter == 'func':
|
||||||
return filter_value(message)
|
return filter_value(message)
|
||||||
elif self.custom_filters and message_filter in self.custom_filters:
|
elif self.custom_filters and message_filter in self.custom_filters:
|
||||||
return self._check_filter(message_filter,filter_value,message)
|
return self._check_filter(message_filter,filter_value,message)
|
||||||
|
elif message_filter == 'state':
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -143,7 +143,6 @@ class RedisHandlerBackend(HandlerBackend):
|
|||||||
return handlers
|
return handlers
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class State:
|
class State:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._states = {}
|
self._states = {}
|
||||||
@ -213,4 +212,4 @@ class StateContext:
|
|||||||
return self.data
|
return self.data
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
return
|
return
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# Versions should comply with PEP440.
|
# Versions should comply with PEP440.
|
||||||
# This line is parsed in setup.py:
|
# This line is parsed in setup.py:
|
||||||
__version__ = '4.0.1'
|
__version__ = '4.1.0'
|
||||||
|
Loading…
Reference in New Issue
Block a user