Skip to content
This repository was archived by the owner on Nov 3, 2022. It is now read-only.

Commit 480adb7

Browse files
committed
ssvideo: add missing check condition
Signed-off-by: Mr.Miss <keselekpermen69@gmail.com>
1 parent 7a74f4b commit 480adb7

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

userbot/modules/ssvideo.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
@register(outgoing=True, pattern=r"^\.ssvideo(?: |$)(.*)")
1818
async def ssvideo(framecap):
19+
if not framecap.reply_to_msg_id():
20+
return await framecap.edit("`reply to video!`")
1921
reply_message = await framecap.get_reply_message()
2022
if not reply_message.media:
21-
await framecap.edit("`reply to a video..`")
22-
return
23+
return await framecap.edit("`reply to a video!`")
2324
try:
2425
frame = int(framecap.pattern_match.group(1))
2526
if frame > 10:
@@ -32,9 +33,9 @@ async def ssvideo(framecap):
3233
or (DocumentAttributeFilename(file_name="sticker.webp")
3334
in reply_message.media.document.attributes)
3435
):
35-
return await framecap.edit("`Unsupported files..`")
36+
return await framecap.edit("`Unsupported files!`")
3637
c_time = time.time()
37-
await framecap.edit("`Downloading media..`")
38+
await framecap.edit("`Downloading media...`")
3839
ss = await bot.download_media(
3940
reply_message,
4041
"anu.mp4",
@@ -43,7 +44,7 @@ async def ssvideo(framecap):
4344
),
4445
)
4546
try:
46-
await framecap.edit("`Proccessing..`")
47+
await framecap.edit("`Proccessing...`")
4748
command = f"vcsi -g {frame}x{frame} {ss} -o ss.png "
4849
os.system(command)
4950
await framecap.client.send_file(
@@ -52,12 +53,9 @@ async def ssvideo(framecap):
5253
reply_to=framecap.reply_to_msg_id,
5354
)
5455
await framecap.delete()
55-
os.system("rm -rf *.png")
56-
os.system("rm -rf *.mp4")
5756
except BaseException as e:
58-
os.system("rm -rf *.png")
59-
os.system("rm -rf *.mp4")
60-
return await framecap.edit(f"{e}")
57+
await framecap.edit(f"{e}")
58+
os.system("rm -rf *.png *.mp4")
6159

6260

6361
CMD_HELP.update({

0 commit comments

Comments
 (0)