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,7 +19,10 @@
• `{i}delpfp <n>(optional)`
Delete one profile pic, if no value given, else delete n number of pics.
• `{i}poto <username>`
• `{i}poto <username>/reply`
`{i}poto <reply/upload-limit>/all`
Ex: `{i}poto 10` - uploads starting 10 pfps of user.
Upload the photo of Chat/User if Available.
"""
import os
@@ -51,8 +54,7 @@ async def _(ult):
@ultroid_cmd(pattern="setname ?((.|//)*)", fullsudo=True)
async def _(ult):
ok = await ult.eor("...")
names = ult.pattern_match.group(1).strip()
first_name = names
names = first_name = ult.pattern_match.group(1).strip()
last_name = ""
if "//" in names:
first_name, last_name = names.split("//", 1)
@@ -111,21 +113,56 @@ async def remove_profilepic(delpfp):
@ultroid_cmd(pattern="poto( (.*)|$)")
async def gpoto(e):
ult = e.pattern_match.group(1).strip()
if e.is_reply:
gs = await e.get_reply_message()
user_id = gs.sender_id
elif ult:
split = ult.split()
user_id = split[0]
if len(ult) > 1:
ult = ult[-1]
else:
ult = None
else:
user_id = e.chat_id
a = await e.eor(get_string("com_1"))
limit = None
just_dl = ult in ["-dl", "--dl"]
if just_dl:
ult = None
if not ult:
if e.is_reply:
gs = await e.get_reply_message()
ult = gs.sender_id
else:
ult = e.chat_id
okla = await e.client.download_profile_photo(ult)
if ult and ult != "all":
try:
limit = int(ult)
except ValueError:
pass
if not limit or e.client._bot:
okla = await e.client.download_profile_photo(user_id)
else:
okla = []
if limit == "all":
limit = None
async for photo in e.client.iter_profile_photos(user_id, limit=limit):
photo_path = await e.client.download_media(photo)
if photo.video_sizes:
await e.respond(file=photo_path)
os.remove(photo_path)
else:
okla.append(photo_path)
if not okla:
return await eor(a, "`Pfp Not Found...`")
if not just_dl:
await a.delete()
await e.reply(file=okla)
return os.remove(okla)
if not isinstance(okla, list):
okla = [okla]
for file in okla:
os.remove(file)
return
if isinstance(okla, list):
okla = "\n".join(okla)
await a.edit(f"Downloaded pfp to [ `{okla}` ].")