Update Ultroid v0.8

---------

Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: Dark <darkbeamer.official@gmail.com>
Co-authored-by: buddhhu <amitsharma123234@gmail.com>
Co-authored-by: Kaif <88398455+kaif-00z@users.noreply.github.com>
Co-authored-by: 1Danish-00 <danish@ultroid.tech>
Co-authored-by: TechiError <techierror@gmail.com>
Co-authored-by: Dark <59723913+DarkBeamerYT@users.noreply.github.com>
This commit is contained in:
Devesh Pal
2023-02-20 10:51:29 +05:30
parent 9746b48e46
commit 09971ca76d
95 changed files with 1857 additions and 3352 deletions

View File

@@ -19,6 +19,10 @@ import random
from telethon.tl.types import InputMessagesFilterPhotos
try:
from PIL import Image
except ImportError:
Image = None
from pyUltroid.fns.misc import unsplashsearch
from pyUltroid.fns.tools import LogoHelper
@@ -45,9 +49,22 @@ async def logo_gen(event):
bg_ = await temp.download_media()
if not bg_:
if event.client._bot:
SRCH = ["blur background", "background", "neon lights", "wallpaper"]
SRCH = [
"blur background",
"background",
"neon lights",
"nature",
"abstract",
"space",
"3d render",
]
res = await unsplashsearch(random.choice(SRCH), limit=1)
bg_ = await download_file(res[0], "resources/downloads/logo.png")
bg_, _ = await download_file(res[0], "resources/downloads/logo.png")
newimg = "resources/downloads/unsplash-temp.jpg"
img_ = Image.open(bg_)
img_.resize((5000, 5000)).save(newimg)
os.remove(bg_)
bg_ = newimg
else:
pics = []
async for i in event.client.iter_messages(