Road to release(1st part)

This commit is contained in:
coder2020official 2022-04-16 00:13:14 +05:00
parent 1688a466f4
commit 22b4e636e2
4 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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