mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Remove unneeded util functions and improve docs
This commit is contained in:
parent
1dc4df8cb1
commit
29fa3ec520
@ -33,21 +33,12 @@ from pyrogram.file_id import FileId, FileType, PHOTO_TYPES, DOCUMENT_TYPES
|
|||||||
|
|
||||||
|
|
||||||
async def ainput(prompt: str = "", *, hide: bool = False):
|
async def ainput(prompt: str = "", *, hide: bool = False):
|
||||||
|
"""Just like the built-in input, but async"""
|
||||||
with ThreadPoolExecutor(1) as executor:
|
with ThreadPoolExecutor(1) as executor:
|
||||||
func = functools.partial(getpass if hide else input, prompt)
|
func = functools.partial(getpass if hide else input, prompt)
|
||||||
return await asyncio.get_event_loop().run_in_executor(executor, func)
|
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(
|
def get_input_media_from_file_id(
|
||||||
file_id: str,
|
file_id: str,
|
||||||
expected_file_type: FileType = None
|
expected_file_type: FileType = None
|
||||||
|
Loading…
Reference in New Issue
Block a user