Minor fix

This commit is contained in:
Yasir Aris M 2023-11-03 09:17:21 +07:00
parent f2f6f240eb
commit 09b66aef02
2 changed files with 21 additions and 22 deletions

View file

@ -61,13 +61,13 @@ SUPPORTED_TYPES = ["jpeg", "png", "webp"]
@app.on_cmd("getsticker")
@use_chat_lang()
async def getsticker_(self: Client, ctx: Message, strings):
if not ctx.reply_to_message or ctx.reply_to_message.sticker:
await ctx.reply_msg(strings("not_sticker"))
else:
if not ctx.reply_to_message:
return await ctx.reply_msg(strings("not_sticker"))
sticker = ctx.reply_to_message.sticker
if not sticker:
return await ctx.reply_msg("Only support sticker..")
if sticker.is_animated:
await ctx.reply_msg(strings("no_anim_stick"))
else:
return await ctx.reply_msg(strings("no_anim_stick"))
with tempfile.TemporaryDirectory() as tempdir:
path = os.path.join(tempdir, "getsticker")
sticker_file = await self.download_media(

View file

@ -96,8 +96,7 @@ async def ytdownv2(self, ctx: Message, strings):
return await ctx.reply_msg(strings("no_channel"))
if ctx.command and len(ctx.command) == 1:
return await ctx.reply_msg(strings("invalid_link"))
msg = ctx.caption if ctx.web_page_preview else ctx.text
url = msg.split()[1]
url = ctx.command[1] if ctx.command and len(ctx.command) > 1 else ctx.text
if not isValidURL(url):
return await ctx.reply_msg(strings("invalid_link"))
async with iYTDL(log_group_id=0, cache_path="cache", silent=True) as ytdl: