From c1b0c501aed843e5c404a2c4db1a22febadc9090 Mon Sep 17 00:00:00 2001 From: Ryuk <88324835+anonymousx97@users.noreply.github.com> Date: Sat, 25 Feb 2023 12:28:34 +0530 Subject: [PATCH] fix bug that didn't send images in right order. --- socialbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socialbot.py b/socialbot.py index 3d9da8e..db08b20 100644 --- a/socialbot.py +++ b/socialbot.py @@ -288,7 +288,7 @@ async def async_download(urls: list, path: str, doc: bool = False, caption: str if doc: return down_loads [os.rename(file, file + ".png") for file in glob.glob(f"{path}/*.webp")] - files = glob.glob(f"{path}/*") + files = [ i + ".png" if i.endswith(".webp") else i for i in down_loads ] grouped_images = [InputMediaPhoto(img, caption=caption) for img in files if img.endswith((".png", ".jpg", ".jpeg"))] grouped_videos = [InputMediaVideo(vid, caption=caption) for vid in files if vid.endswith((".mp4", ".mkv", ".webm"))] return_list = [grouped_images[imgs : imgs + 5] for imgs in range(0, len(grouped_images), 5)] + [