Remove unneeded util functions and improve docs

This commit is contained in:
Dan 2020-12-20 17:57:41 +01:00
parent 1dc4df8cb1
commit 29fa3ec520

View File

@ -33,21 +33,12 @@ from pyrogram.file_id import FileId, FileType, PHOTO_TYPES, DOCUMENT_TYPES
async def ainput(prompt: str = "", *, hide: bool = False):
"""Just like the built-in input, but async"""
with ThreadPoolExecutor(1) as executor:
func = functools.partial(getpass if hide else input, prompt)
return await asyncio.get_event_loop().run_in_executor(executor, func)
def get_offset_date(dialogs):
for m in reversed(dialogs.messages):
if isinstance(m, raw.types.MessageEmpty):
continue
else:
return m.date
else:
return 0
def get_input_media_from_file_id(
file_id: str,
expected_file_type: FileType = None