mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1500 from coder2020official/master
Road to release(1st part)
This commit is contained in:
commit
110575ca40
@ -3849,6 +3849,9 @@ class TeleBot:
|
||||
elif len(params) == 3:
|
||||
if params[2] == 'bot' and handler.get('pass_bot') is True:
|
||||
handler['function'](message, data, self)
|
||||
|
||||
elif not handler.get('pass_bot'):
|
||||
raise RuntimeError('Your handler accepts 3 parameters but pass_bot is False. Please re-check your handler.')
|
||||
|
||||
else:
|
||||
handler['function'](message, self, data)
|
||||
|
@ -303,7 +303,7 @@ class StateFilter(AdvancedCustomFilter):
|
||||
group_state = await self.bot.current_states.get_state(user_id, chat_id)
|
||||
if group_state == text:
|
||||
return True
|
||||
elif group_state in text and type(text) is list:
|
||||
elif type(text) is list and group_state in text:
|
||||
return True
|
||||
|
||||
|
||||
|
@ -67,6 +67,7 @@ async def _process_request(token, url, method='get', params=None, files=None, re
|
||||
logger.debug("Request: method={0} url={1} params={2} files={3} request_timeout={4} current_try={5}".format(method, url, params, files, request_timeout, current_try).replace(token, token.split(':')[0] + ":{TOKEN}"))
|
||||
json_result = await _check_result(url, resp)
|
||||
if json_result:
|
||||
got_result = True
|
||||
return json_result['result']
|
||||
except (ApiTelegramException,ApiInvalidJSONException, ApiHTTPException) as e:
|
||||
raise e
|
||||
|
@ -311,7 +311,7 @@ class StateFilter(AdvancedCustomFilter):
|
||||
group_state = self.bot.current_states.get_state(user_id, chat_id)
|
||||
if group_state == text:
|
||||
return True
|
||||
elif group_state in text and type(text) is list:
|
||||
elif type(text) is list and group_state in text:
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user