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 -
@@ -27,7 +26,6 @@
• `{i}thumbnail <reply to image/thumbnail file>`
Upload Your file with your custom thumbnail.
"""
import os
import time
@@ -51,10 +49,10 @@ async def _(e):
if not r:
return await eor(e, pop)
if isinstance(r.media, photu):
dl = await ultroid_bot.download_media(r.media)
dl = await e.client.download_media(r.media)
elif isinstance(r.media, doc):
if r.media.document.thumbs:
dl = await ultroid_bot.download_media(r, thumb=-1)
dl = await e.client.download_media(r, thumb=-1)
else:
return await eor(e, pop)
variable = uf(dl)
@@ -76,7 +74,7 @@ async def imak(event):
return
inp = event.pattern_match.group(1)
if not inp:
await eor(event, "Give The name nd extension of file")
await eor(event, "Give The name and extension of file")
return
xx = await eor(event, "`Processing...`")
if reply.media:
@@ -91,13 +89,11 @@ async def imak(event):
os.rename(file, inp)
k = time.time()
xxx = await uploader(inp, inp, k, xx, "Uploading...")
await ultroid_bot.send_file(
event.chat_id,
xxx,
await event.reply(
f"`{xxx.name}`",
file=xxx,
force_document=True,
thumb="resources/extras/ultroid.jpg",
caption=f"`{xxx.name}`",
reply_to=reply,
)
os.remove(inp)
await xx.delete()
@@ -112,7 +108,7 @@ async def imak(event):
await eor(event, "Reply to any media.")
return
xx = await eor(event, "`Processing...`")
image = await ultroid_bot.download_media(reply)
image = await reply.download_media()
file = "ult.png"
if image.endswith((".webp", ".png")):
c = Image.open(image)
@@ -121,7 +117,7 @@ async def imak(event):
img = cv2.VideoCapture(image)
ult, roid = img.read()
cv2.imwrite(file, roid)
await ultroid_bot.send_file(event.chat_id, file, reply_to=reply)
await event.reply(file=file)
await xx.delete()
os.remove(file)
os.remove(image)
@@ -136,7 +132,7 @@ async def smak(event):
await eor(event, "Reply to any media.")
return
xx = await eor(event, "`Processing...`")
image = await ultroid_bot.download_media(reply)
image = await reply.download_media()
file = "ult.webp"
if image.endswith((".webp", ".png", ".jpg")):
c = Image.open(image)
@@ -145,7 +141,7 @@ async def smak(event):
img = cv2.VideoCapture(image)
ult, roid = img.read()
cv2.imwrite(file, roid)
await ultroid_bot.send_file(event.chat_id, file, reply_to=reply)
await event.reply(file=file)
await xx.delete()
os.remove(file)
os.remove(image)
@@ -157,7 +153,7 @@ async def smak(event):
async def _(event):
input_str = event.pattern_match.group(1)
if not input_str:
return await eod(event, "`Bsdk Give Name.`")
return await eod(event, "`Give The File Name.`")
xx = await eor(event, get_string("com_1"))
if event.reply_to_msg_id:
a = await event.get_reply_message()
@@ -168,9 +164,7 @@ async def _(event):
b.write(str(a.message))
b.close()
await xx.edit(f"**Packing into** `{input_str}`")
await event.client.send_file(
event.chat_id, input_str, thumb="resources/extras/ultroid.jpg"
)
await event.reply(file=input_str, thumb="resources/extras/ultroid.jpg")
await xx.delete()
os.remove(input_str)
@@ -198,12 +192,8 @@ async def _(event):
await xx.edit(
f"**MESSAGE EXCEEDS TELEGRAM LIMITS**\n\nSo Pasted It On [NEKOBIN](https://nekobin.com/{key})"
)
elif "dog" in what:
await xx.edit(
f"**MESSAGE EXCEEDS TELEGRAM LIMITS**\n\nSo Pasted It On [DOGBIN](https://del.dog/{key})"
)
os.remove(b)
else:
return await eod(xx, "`Reply to a readable file`", time=5)
return await eod(xx, "`Reply to a readable file`")
else:
return await eod(xx, "`Reply to a readable file`", time=5)
return await eod(xx, "`Reply to a readable file`")