mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-06 11:54:51 +00:00
Minor fix
This commit is contained in:
parent
f2f6f240eb
commit
09b66aef02
2 changed files with 21 additions and 22 deletions
|
|
@ -61,13 +61,13 @@ SUPPORTED_TYPES = ["jpeg", "png", "webp"]
|
||||||
@app.on_cmd("getsticker")
|
@app.on_cmd("getsticker")
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
async def getsticker_(self: Client, ctx: Message, strings):
|
async def getsticker_(self: Client, ctx: Message, strings):
|
||||||
if not ctx.reply_to_message or ctx.reply_to_message.sticker:
|
if not ctx.reply_to_message:
|
||||||
await ctx.reply_msg(strings("not_sticker"))
|
return await ctx.reply_msg(strings("not_sticker"))
|
||||||
else:
|
|
||||||
sticker = ctx.reply_to_message.sticker
|
sticker = ctx.reply_to_message.sticker
|
||||||
|
if not sticker:
|
||||||
|
return await ctx.reply_msg("Only support sticker..")
|
||||||
if sticker.is_animated:
|
if sticker.is_animated:
|
||||||
await ctx.reply_msg(strings("no_anim_stick"))
|
return await ctx.reply_msg(strings("no_anim_stick"))
|
||||||
else:
|
|
||||||
with tempfile.TemporaryDirectory() as tempdir:
|
with tempfile.TemporaryDirectory() as tempdir:
|
||||||
path = os.path.join(tempdir, "getsticker")
|
path = os.path.join(tempdir, "getsticker")
|
||||||
sticker_file = await self.download_media(
|
sticker_file = await self.download_media(
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,7 @@ async def ytdownv2(self, ctx: Message, strings):
|
||||||
return await ctx.reply_msg(strings("no_channel"))
|
return await ctx.reply_msg(strings("no_channel"))
|
||||||
if ctx.command and len(ctx.command) == 1:
|
if ctx.command and len(ctx.command) == 1:
|
||||||
return await ctx.reply_msg(strings("invalid_link"))
|
return await ctx.reply_msg(strings("invalid_link"))
|
||||||
msg = ctx.caption if ctx.web_page_preview else ctx.text
|
url = ctx.command[1] if ctx.command and len(ctx.command) > 1 else ctx.text
|
||||||
url = msg.split()[1]
|
|
||||||
if not isValidURL(url):
|
if not isValidURL(url):
|
||||||
return await ctx.reply_msg(strings("invalid_link"))
|
return await ctx.reply_msg(strings("invalid_link"))
|
||||||
async with iYTDL(log_group_id=0, cache_path="cache", silent=True) as ytdl:
|
async with iYTDL(log_group_id=0, cache_path="cache", silent=True) as ytdl:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue