v0.0.9 18/07/2021

Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com>
Co-authored-by: Aditya <me@xditya.me>
Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com>
Co-authored-by: sppidy <sppidy@users.noreply.github.com>
Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com>
Co-authored-by: divkix <divkix@users.noreply.github.com>
Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com>
Co-authored-by: Programming Error <error@notavailable.live>
This commit is contained in:
1Danish-00
2021-07-18 17:47:15 +05:30
parent 71fddc8844
commit 386eff647c
140 changed files with 3363 additions and 3068 deletions

View File

@@ -4,7 +4,6 @@
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
@@ -23,7 +22,6 @@
• `{i}poto <username>`
Upload the photo of Chat/User if Available.
"""
import asyncio
import os
@@ -51,7 +49,7 @@ async def _(ult):
ok = await eor(ult, "...")
set = ult.pattern_match.group(1)
try:
await ultroid_bot(UpdateProfileRequest(about=set))
await ult.client(UpdateProfileRequest(about=set))
await ok.edit(f"Profile bio changed to\n`{set}`")
except Exception as ex:
await ok.edit("Error occured.\n`{}`".format(str(ex)))
@@ -75,7 +73,7 @@ async def _(ult):
if "//" in names:
first_name, last_name = names.split("//", 1)
try:
await ultroid_bot(
await ult.client(
UpdateProfileRequest(
first_name=first_name,
last_name=last_name,
@@ -102,13 +100,13 @@ async def _(ult):
reply_message = await ult.get_reply_message()
ok = await eor(ult, "...")
replfile = await reply_message.download_media()
file = await ultroid_bot.upload_file(replfile)
file = await ult.client.upload_file(replfile)
mediain = mediainfo(reply_message.media)
try:
if "pic" in mediain:
await ultroid_bot(UploadProfilePhotoRequest(file))
await ult.client(UploadProfilePhotoRequest(file))
elif "gif" or "video" in mediain:
await ultroid_bot(UploadProfilePhotoRequest(video=file))
await ult.client(UploadProfilePhotoRequest(video=file))
else:
return await ok.edit("`Invalid MEDIA Type !`")
await ok.edit("`My Profile Photo has Successfully Changed !`")
@@ -136,7 +134,7 @@ async def remove_profilepic(delpfp):
lim = int(group)
else:
lim = 1
pfplist = await ultroid_bot(
pfplist = await delpfp.client(
GetUserPhotosRequest(user_id=delpfp.from_id, offset=0, max_id=0, limit=lim),
)
input_photos = []
@@ -148,7 +146,7 @@ async def remove_profilepic(delpfp):
file_reference=sep.file_reference,
),
)
await ultroid_bot(DeletePhotosRequest(id=input_photos))
await delpfp.client(DeletePhotosRequest(id=input_photos))
await ok.edit(f"`Successfully deleted {len(input_photos)} profile picture(s).`")
await asyncio.sleep(10)
await ok.delete()
@@ -164,13 +162,13 @@ async def gpoto(e):
if not (ult or e.is_reply):
ult = e.chat_id
try:
okla = await ultroid_bot.download_profile_photo(
okla = await e.client.download_profile_photo(
ult,
"profile.jpg",
download_big=True,
)
await a.delete()
await ultroid_bot.send_message(e.chat_id, file=okla)
await e.reply(file=okla)
os.remove(okla)
except Exception as er:
await eor(e, f"ERROR - {str(er)}")