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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user