1
0
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:
Badiboy 2022-04-15 22:49:02 +03:00 committed by GitHub
commit 110575ca40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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