mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 22:46:01 +00:00
try out fasttelethon
This commit is contained in:
@@ -10,6 +10,7 @@ from howdoi import howdoi
|
||||
from PIL import Image
|
||||
from telethon.tl.types import DocumentAttributeVideo
|
||||
|
||||
from ubot.fixes.fast_telethon import upload_file
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
os.environ["HOWDOI_SEARCH_ENGINE"] = "bing"
|
||||
@@ -197,8 +198,9 @@ async def youtube_cmd(event):
|
||||
try:
|
||||
if await ldr.cache.is_cache_required(video_stream.url):
|
||||
file_path = await ldr.cache.cache_file(video_stream.url, f"{event.chat_id}_{event.id}")
|
||||
file_handle = await upload_file(event.client, file_path)
|
||||
|
||||
await event.client.send_file(event.chat, file=file_path, attributes=[
|
||||
await event.client.send_file(event.chat, file=file_handle, reply_to=event, attributes=[
|
||||
DocumentAttributeVideo(
|
||||
duration=video.length,
|
||||
w=video_stream.dimensions[0],
|
||||
|
Reference in New Issue
Block a user