Compare commits
5 Commits
f4c5dd0d22
...
4fd01e3ac8
Author | SHA1 | Date |
---|---|---|
_run | 4fd01e3ac8 | |
_run | b4c28de104 | |
_run | de344bd5e0 | |
_run | e3a4fdff9a | |
_run | 71d3ec8b42 |
|
@ -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(user_id, chat_id)
|
||||
group_state = await self.bot.current_states.get_state(chat_id, user_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(user_id, chat_id)
|
||||
user_state = await self.bot.current_states.get_state(chat_id, user_id)
|
||||
if user_state == text:
|
||||
return True
|
||||
elif type(text) is list and user_state in text:
|
||||
|
|
|
@ -159,15 +159,13 @@ 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:
|
||||
# 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)
|
||||
|
||||
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()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
|
|
@ -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(user_id, chat_id)
|
||||
group_state = self.bot.current_states.get_state(chat_id, user_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(user_id, chat_id)
|
||||
user_state = self.bot.current_states.get_state(chat_id, user_id)
|
||||
if user_state == text:
|
||||
return True
|
||||
elif type(text) is list and user_state in text:
|
||||
|
|
Loading…
Reference in New Issue