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
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:
return True
elif type(text) is list and group_state in text:
@ -428,7 +428,7 @@ class StateFilter(AdvancedCustomFilter):
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:
return True
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):
if FILE_URL is None:
url = "https://api.telegram.org/file/bot{0}/{1}".format(token, file_path)
else: url = FILE_URL.format(token, file_path)
session = await session_manager.get_session()
async with session.get(url, proxy=proxy) as response:
if response.status != 200:
raise ApiHTTPException('Download file', result)
result = await response.read()
else:
# noinspection PyUnresolvedReferences
url = FILE_URL.format(token, file_path)
async with await session_manager.get_session() as session:
async with session.get(url, proxy=proxy) as response:
result = await response.read()
if response.status != 200:
raise ApiHTTPException('Download file', result)
return result

View File

@ -428,7 +428,7 @@ class StateFilter(AdvancedCustomFilter):
text = text.name
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:
return True
elif type(text) is list and group_state in text:
@ -436,7 +436,7 @@ class StateFilter(AdvancedCustomFilter):
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:
return True
elif type(text) is list and user_state in text: