Compare commits

..

No commits in common. "4fd01e3ac81175411a46e0cb0b6be8962925c64a" and "f4c5dd0d22492ce112a8c95994f75484544971dc" have entirely different histories.

3 changed files with 13 additions and 11 deletions

View File

@ -420,7 +420,7 @@ class StateFilter(AdvancedCustomFilter):
text = text.name text = text.name
if message.chat.type in ['group', 'supergroup']: if message.chat.type in ['group', 'supergroup']:
group_state = await self.bot.current_states.get_state(chat_id, user_id) group_state = await self.bot.current_states.get_state(user_id, chat_id)
if group_state == text: if group_state == text:
return True return True
elif type(text) is list and group_state in text: elif type(text) is list and group_state in text:
@ -428,7 +428,7 @@ class StateFilter(AdvancedCustomFilter):
else: else:
user_state = await self.bot.current_states.get_state(chat_id, user_id) user_state = await self.bot.current_states.get_state(user_id, chat_id)
if user_state == text: if user_state == text:
return True return True
elif type(text) is list and user_state in text: elif type(text) is list and user_state in text:

View File

@ -159,13 +159,15 @@ async def get_file_url(token, file_id):
async def download_file(token, file_path): async def download_file(token, file_path):
if FILE_URL is None: if FILE_URL is None:
url = "https://api.telegram.org/file/bot{0}/{1}".format(token, file_path) url = "https://api.telegram.org/file/bot{0}/{1}".format(token, file_path)
else: url = FILE_URL.format(token, file_path) else:
session = await session_manager.get_session() # noinspection PyUnresolvedReferences
async with session.get(url, proxy=proxy) as response: url = FILE_URL.format(token, file_path)
if response.status != 200: async with await session_manager.get_session() as session:
raise ApiHTTPException('Download file', result) async with session.get(url, proxy=proxy) as response:
result = await response.read() result = await response.read()
if response.status != 200:
raise ApiHTTPException('Download file', result)
return result return result

View File

@ -428,7 +428,7 @@ class StateFilter(AdvancedCustomFilter):
text = text.name text = text.name
if message.chat.type in ['group', 'supergroup']: if message.chat.type in ['group', 'supergroup']:
group_state = self.bot.current_states.get_state(chat_id, user_id) group_state = self.bot.current_states.get_state(user_id, chat_id)
if group_state == text: if group_state == text:
return True return True
elif type(text) is list and group_state in text: elif type(text) is list and group_state in text:
@ -436,7 +436,7 @@ class StateFilter(AdvancedCustomFilter):
else: else:
user_state = self.bot.current_states.get_state(chat_id, user_id) user_state = self.bot.current_states.get_state(user_id, chat_id)
if user_state == text: if user_state == text:
return True return True
elif type(text) is list and user_state in text: elif type(text) is list and user_state in text: