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
|
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(user_id, chat_id)
|
group_state = await self.bot.current_states.get_state(chat_id, user_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(user_id, chat_id)
|
user_state = await self.bot.current_states.get_state(chat_id, user_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:
|
||||||
|
|
|
@ -159,15 +159,13 @@ 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:
|
else: url = FILE_URL.format(token, file_path)
|
||||||
# noinspection PyUnresolvedReferences
|
session = await session_manager.get_session()
|
||||||
url = FILE_URL.format(token, file_path)
|
async with session.get(url, proxy=proxy) as response:
|
||||||
async with await session_manager.get_session() as session:
|
if response.status != 200:
|
||||||
async with session.get(url, proxy=proxy) as response:
|
raise ApiHTTPException('Download file', result)
|
||||||
result = await response.read()
|
result = await response.read()
|
||||||
if response.status != 200:
|
|
||||||
raise ApiHTTPException('Download file', result)
|
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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(user_id, chat_id)
|
group_state = self.bot.current_states.get_state(chat_id, user_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(user_id, chat_id)
|
user_state = self.bot.current_states.get_state(chat_id, user_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:
|
||||||
|
|
Loading…
Reference in New Issue