mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
Minor fix
This commit is contained in:
parent
f2f6f240eb
commit
09b66aef02
2 changed files with 21 additions and 22 deletions
|
|
@ -61,26 +61,26 @@ 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:
|
||||
sticker = ctx.reply_to_message.sticker
|
||||
if sticker.is_animated:
|
||||
await ctx.reply_msg(strings("no_anim_stick"))
|
||||
else:
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
path = os.path.join(tempdir, "getsticker")
|
||||
sticker_file = await self.download_media(
|
||||
message=ctx.reply_to_message,
|
||||
file_name=f"{path}/{sticker.set_name}.png",
|
||||
)
|
||||
await ctx.reply_to_message.reply_document(
|
||||
document=sticker_file,
|
||||
caption=f"<b>Emoji:</b> {sticker.emoji}\n"
|
||||
f"<b>Sticker ID:</b> <code>{sticker.file_id}</code>\n\n"
|
||||
f"<b>Send by:</b> @{self.me.username}",
|
||||
)
|
||||
shutil.rmtree(tempdir, ignore_errors=True)
|
||||
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:
|
||||
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(
|
||||
message=ctx.reply_to_message,
|
||||
file_name=f"{path}/{sticker.set_name}.png",
|
||||
)
|
||||
await ctx.reply_to_message.reply_document(
|
||||
document=sticker_file,
|
||||
caption=f"<b>Emoji:</b> {sticker.emoji}\n"
|
||||
f"<b>Sticker ID:</b> <code>{sticker.file_id}</code>\n\n"
|
||||
f"<b>Send by:</b> @{self.me.username}",
|
||||
)
|
||||
shutil.rmtree(tempdir, ignore_errors=True)
|
||||
|
||||
|
||||
@app.on_message(filters.command("stickerid", COMMAND_HANDLER) & filters.reply)
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue